Re: Current project as XML string
panku.donald_at_gmail.com
Date: 12/28/04
- Previous message: Rod Gill: "Re: Saving as ODBC to SQL Server. Project is locked."
- Messages sorted by: [ date ] [ thread ]
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/
- Previous message: Rod Gill: "Re: Saving as ODBC to SQL Server. Project is locked."
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|