Passing prameters

K

Kishore

Hi,
I want to convert a microsoft project file into xml file.. Below is
the code :

<%
Dim a
Set a= Server.CreateObject("MSProject.Application")

Dim objFSO
Set objFSO = Server.CreateObject("Scripting.FileSystemObject")
If objFSO.FileExists(Server.MapPath("1.xml")) Then
objFSO.DeleteFile Server.MapPath("1.xml")
End IF
a.FileOpen Server.MapPath ("1.mpp")
a.FileSaveAs Server.MapPath ("1.xml")
'a.FileCloseAll
Response.write "...Success ...009"
%>

I am creating the application object and asking it to save as XML. I need to
specify the FormatID inthe filesaveas parameter. But how to do that. In VBA ,
we do like
FileSave As Name:="1.xm;",FormatID:="MSProject.XML" .... I need to pass
this parameter to get it done. How to do that.

Presently this is writing a 1.xml file but that is not in the XML format. I
suspect the file is written in the MPP format. Plz help...
 
R

Ray Costanzo [MVP]

1. You're creating a server-side instance of Project which is a highly
ill-advised thing to do.
2. If ignoring #1, try:

a.SaveAs Server.MapPath("1.xml"), , , , , , , , , "MSProject.XML"

Ray at work
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,995
Messages
2,570,230
Members
46,817
Latest member
DicWeils

Latest Threads

Top