Invisible loading and conversion!

R

Rahul

Hi!
Is there a way by which I can save a xml string (as per ms project 2003 xml
schema) as a mpp file without opening the project file on the Project
Professional application. I mean, the save should happen at the background.
Also, is there a way by which I can load xml data from mpp file without
having to open the file on the Project Professional application? Again, this
should happen at the background.

Thank you.
Rahul.
 
J

JackD

Have you tried going through the OLEDB provider? It should let you read the
file without opening project. It won't let you write to the file however.

Find the details in the file called pjoledb.htm on your project disk.

-Jack
 
R

Rahul

Hi!
I'm not convinced with using OLEDB...as of now, i'm opening the mpp on the
Application in a new window, saving into a temp file as xml with saveas
option and then closing the loaded mpp window.
Is this a rite approach...what i finally need is the xml...is there a
single step conversion from mpp file to xml without havin' to do the steps
that i used above?
Also,
I tried the following...
Dim p As MSProject.Project

Dim xmldom As New msxml2.domdocument

App.FileOpen(Name:="C:\1.mpp", ReadOnly:="True")

App.FileSaveAs(FormatID:="MSProject.XMLDOM", XMLName:=xmldom)

App.FileClose(PjSaveType.pjDoNotSave)

This is as per the help file sample code.
I get an "invalid argument" at the filesaveas line. The code works fine when
I run it as a macro...doesn't work with VB.NET managed add-in.Whaz the
correct approach?

Note: I referenced MSXML2 dll as the help file suggested.

Thank you.
Rahul.
 
J

JackD

Either you write the XML (getting data using oledb or whatever and then
translating) or let project do it.
Your approach is easiest. There is no simpler way. You do not need to make
the application visible if that helps.

-Jack
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top