Passing prameters

Discussion in 'ASP General' started by Kishore, Feb 10, 2005.

  1. Kishore

    Kishore Guest

    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...
     
    Kishore, Feb 10, 2005
    #1
    1. Advertising

  2. 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" <> wrote in message
    news:...
    > 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...
     
    Ray Costanzo [MVP], Feb 10, 2005
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Victor Bazarov
    Replies:
    25
    Views:
    892
    E. Robert Tisdale
    Mar 23, 2005
  2. vyshu
    Replies:
    0
    Views:
    379
    vyshu
    Apr 11, 2007
  3. pereges
    Replies:
    7
    Views:
    438
    pereges
    Jun 1, 2008
  4. Ramon F Herrera
    Replies:
    8
    Views:
    483
    Pascal J. Bourguignon
    Sep 13, 2009
  5. deadpickle
    Replies:
    1
    Views:
    987
    Jens Thoms Toerring
    Nov 7, 2010
Loading...

Share This Page