|
Prev: ASP error under Windows 2003
Next: How can I check if CDO.SYS is working properly on Win2003/IIS 6.0?
From: Kishore on 10 Feb 2005 05:33 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 10 Feb 2005 09:14
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... |