how to create .mpp project file without using MS Project???

L

liu

how to create .mpp project file without using MS Project???
does microsoft provides any API to allow us to create the .mpp file by our
own???
 
R

Rod Gill

Hi,

No. However, you can create a database with a new project's information and
MS Project can open it. Search for and thoroughly digest the projdb.htm file
in one of Projects program folders for a full schema.

To create a sample database save a project as a .mpd file, which is an
Access database file.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
 
L

liu

Hi,

i read the MS PRoject SDK 2003, from there, the SDK said that we can add the
project without using MS Project by set reference to:

Dim prj As New Microsoft.Office.Interop.MSProject.ApplicationClass

so, i tried this by :
prj.Projects.Add(False, , False).Subject = "Project Subject"
prj.Projects.Add(False, , False).Title = "Project title"
prj.Projects.Add(False, , False).Tasks.Add.Name = "Task Name"
pprj.Projects.Add(False, , False).Resources.Add.Name = "Liu Pin
Chiang"
prj.Projects.Add.SaveAs("c:/TestingProject.mpp",
Microsoft.Office.Interop.MSProject.PjFileFormat.pjMPP, , , , , , , , , , , ,
, )

i can create the .mpp file by this, but, it opens 1 project file for each of
the "add" command.
I really don't know what to do and how to add the Project information, such
as resources, startdate, enddate and so on. the sdk is not details enough.

hope you all can help, thanks.

liu
 
R

Rod Gill

That's because you executed 5 create new project statements!!!!!

The add statement returns an object to the new project, so:
dim projapp as msproject.application
dim T as Task
set prj= projapp..Projects.Add(False, , False)
prj.BuiltinDocumentProperties("Subject") = "Project Subject"
prj.BuiltinDocumentProperties("Title") = "Project title"
set t=prj.Tasks.Add.Name
t.name= "Task Name"
prj.Resources.Add.Name = "Liu Pin Chiang"
projapp.Add.SaveAs("c:/TestingProject.mpp",
Microsoft.Office.Interop.MSProject.PjFileFormat.pjMPP, , , , , , , , , , , ,

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
 
L

liu

i tried the code that you suggested, but it cannot work. for an example:
there is no this property===> BuiltinDocumentProperties
i don't whether i had miss to add any reference or what. do you have any
working sample code or reference???

thanks.
 
R

Rod Gill

Hi,

I don't have VB.Net available, so in Project go to the VBA editor (Alt+F11)
and look at the object model. It's under the project object. Either you
haven't created a project object, or your library isn't supporting it.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
 
L

liu

Hi,

in other word, isit mean that it is impossible to create the .mpp file
without using the MS Project software???

for my opinion, there is some way that we can create the .mpp file without
using the Project, but i just don't how to do. and i also knew that there are
some software sell in the net to create and view the .mpp file.
 
R

Rod Gill

Hi,

That code creates the file. Your original code created 4 or more files.
Projects.Add creates a new file. The only way to create a new file is via
automation. You can however create data for new projects by creating the
correct data in a database and have Project read the project for the
database. Try saving a project as a .mpd file (Access format) or any ODBC
format and thoroughly digest the projdb.htm file that's in one of Project's
program folders.

--
For VBA posts, please use the public.project.developer group.
For any version of Project use public.project
For any version of Project Server use public. project.server

Rod Gill
Project MVP
For Microsoft Project companion projects, best practices and Project VBA
development services
visit www.project-systems.co.nz/
Email rodg AT project-systems DOT co DOT nz
 

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