From: Kishore on
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...
From: "Ray Costanzo [MVP]" <my first name at lane 34 dot on
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

"Kishore" <Kishore(a)discussions.microsoft.com> wrote in message
news:72143C45-8971-4224-B21D-8C641F6FEEE4(a)microsoft.com...
> 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...