Create New file from Existing Project Template

C

Chester

Hello,
Is it possible to specify template name from existing Project Templates set
when creating a file?
For example, I want to use "Annual Report Preparation" template (this one is
the first in "Project Template" tab for Project Professional 2007).

If I try prObject.FileNew(False, "some_template")
it only allows to specify a path to template file but not template name.


Thank you.
 
C

Chester

Thank you,
I need to do automatic file creation on the basis of template without user
interaction.

How can I open template from VBA without using absolute path?

Is it possible to enumerate available templates using VBA?


Regards
 
R

Rod Gill

There has to be a full path, so create a constant to hold it or read the
full path for templates from a folder on the server.

Once you have a folder name you can use the VBA method Dir to read all files
in a folder:

Dim Path as string
path=Dir("C:\My Templates\*.mpt")
Do until path=""
Debug.Print Path
path=Dir
Loop

--

Rod Gill
Project MVP

Project VBA Book, for details visit:
http://www.projectvbabook.com

NEW!! Web based VBA training course delivered by me. For details visit:
http://projectservertraining.com/learning/index.aspx
 
C

Chester

Thnk you,
Is it possible to create file on the basis of one of "Enterprise Templates"?
How to specify path in this case?
And how to enumerate available to Project Professional Local of Enterprise
templates?

Thank you.
 
C

Chester

The recording of the macro was:

FileOpenEx Name:="<>\", ReadOnly:=False, FormatID:="MSProject.PSI.12"

So instead of name of the template was some cryptic string.
So for now i don't know how to specify a name of enterprize template in a
macro.

Thank you
 
M

Maik

Hi Chester,

specify the Enterprise Template name
FileOpenEx Name:="<>\MyTemplate", ReadOnly:=False,
FormatID:="MSProject.PSI.12"

Hope this helps
Maik
 

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