Re: Current project as XML string

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

panku.donald_at_gmail.com
Date: 12/28/04

  • Next message: JackD: "Re: How do I import indented task data in Excel format into Project?"
    Date: 28 Dec 2004 11:27:26 -0800
    
    

    Hi,

    I am trying to do the same thing using JScript using following code.
    But always gives me an error that argument is not valid.

    Following is the code.

    var projectXMLDom = "MSProject.XMLDOM";
    projectDOM = new ActiveXObject("MSXML2.DOMDocument.4.0");
    projectDOM.async = false;
    application.FileSaveAs(null, null, null, null,
    null, null, null, null, null, projectXML , null,
    null,
    null, null, null, null, null,
    projectDOM);
    alert(projectDOM.xml);

    Do any one know how to fix this error.

    Thanks in advance. Pranav

    Martin Kofoed wrote:
    > I managed to fix it using this piece of code:
    >
    > ====
    >
    > Dim app As MSProject.Application
    > Set app = GetObject(, "MSProject.Application")
    >
    > Dim xmldoc
    > Set xmldoc = CreateObject("MSXML2.DOMdocument")
    > xmldoc.async = False
    >
    > app.FileSaveAs FormatID:="MSProject.XMLDOM",XMLName:=xmldoc
    > MsgBox (xmldoc.xml) ' this will output the project as XML
    > in a MsgBox
    >
    > ====
    >
    > Seems odd that you have to go via the FileSaveAs
    > functionality, but anyway - it works!
    >
    >
    > /Martin
    >
    >
    > >-----Original Message-----
    > >Hi,
    > >
    > >Not that I know of. However, xml is easy enough to create.
    > Use an Open
    > >statement to create/open a new text file then use write
    > statements to send
    > >text lines to it. You can then create whatever xml files
    > you want.
    > >
    > >--
    > >Rod Gill
    > >Project MVP
    > >For Microsoft Project companion projects, best practices
    > and Project VBA
    > >development services
    > >visit www.projectlearning.com/


  • Next message: JackD: "Re: How do I import indented task data in Excel format into Project?"

    Relevant Pages

    • Re: Solaris OS versions supported on the cool thread series
      ... In theory you _could_ fix the ... You mean in the new services facility that replaced init.d ... IIRC all the config info is in XML? ... /var/svcs/profile looks pretty readable to me, and XML files ...
      (comp.sys.sun.hardware)
    • Re: office 2007 help files
      ... the problem was that the XML files was changed ... So I opened the registry editor ... ... Thanks a lot thepisu. ... Your fix works fine and solved my issue. ...
      (microsoft.public.office.misc)
    • Re: default namespace / Xmlvalidatingreader
      ... i'm receiving such xml files, so one way or the other i have to add the ... push it to the xmlvalidatingreader. ... but that can't be the best way to fix this, ...
      (microsoft.public.dotnet.xml)