Moving Custom Fields into the Project 2002 Global Template File

D

Dean

I've not been able to move custom fields into the Project 2002 Global.mpt
file with the OrganizerMoveItem method. I don't get an error message; the
problem is that nothing happens. This code (on a single line) never works:
OrganizerMoveItem Type:=pjFields, FileName:=thisFileName,
ToFileName:="GLOBAL.MPT", Name:="Date1"

This code has worked unpredictably on a few occasions:
OrganizerMoveItem Type:=pjFields, FileName:=thisFileName,
ToFileName:="Global.MPT", Task:=True

I'm wondering what I'm missing.

Thanks!
 
J

John

Dean said:
I've not been able to move custom fields into the Project 2002 Global.mpt
file with the OrganizerMoveItem method. I don't get an error message; the
problem is that nothing happens. This code (on a single line) never works:
OrganizerMoveItem Type:=pjFields, FileName:=thisFileName,
ToFileName:="GLOBAL.MPT", Name:="Date1"

This code has worked unpredictably on a few occasions:
OrganizerMoveItem Type:=pjFields, FileName:=thisFileName,
ToFileName:="Global.MPT", Task:=True

I'm wondering what I'm missing.

Thanks!

Dean,
I haven't tried to move items into the Global file with VBA but one
thing does come to mind. Depending on your configuration there may be
more than one Global file on your PC. I have multiple Globals because I
have three separate versions of Project installed. Even if you do not
have more than one version installed there could still be more than one
Global. Try this, include the whole path name for the Global in the
"ToFileName" argument. Just make sure you have the correct Global.

Hope this helps.
John
Project MVP
 
J

Jan De Messemaeker

Hi,

You're absolutely right, this doesn't work :-((
I have had the problem a few years ago and I have use 2 workarounds:

In one case I could afford to move ALL of the custom fields of one type, and
that works.
In an other case I did not copy the field but defined it through VBA
directly in the global.

Hope this helps
 
D

Dean

Jan
Thanks for the help. I haven't had consistent success moving all field of a
certain type. I'm desperate enough to try creating the fields in the Global
file, but don't see how I can do that working with the various custom field
methods. It looks like I will end up creating the custom fields in a specific
project file rather than in the Global template. Please advise.

PS Has Microsoft acknowledged that the OrganizerMoveItem command doesn't
work with fields? Do you know of a KB article on this?
 
D

Dean

John
A belated "thanks" for your suggestion. I tried it without success. Jan De
Messemaeker suggested creatiing the fields directly in the Global template,
but I don't see how to do that with the various methods available. It looks
like I will end up defining the fields in a project file rather than the
global.

This problem is part of a larger issue of configuring a user's Global
template without having to replace it altogether.

Dean
 
J

Jan De Messemaeker

Hi,

You're right unfortunately.
I verified the application I made for a customer and indeed I create teh
custom field directly into the tarhet mpp file (from a VBA procedure stored
in the global).

HTH
 
D

Dean Reed

Jan
What am I to do? Is there no way aside from replacing the user's active
Global.mpt file? I can't believe that Microsoft hasn't fixed this from 2002,
when I first discoverd the OrganizerMoveItem method didn't work for custom
fields. Do you think it would be worthwhile to call Microsoft?

Best,
Dean
 
J

Jan De Messemaeker

Hi,

Replacing the user's global would be a manual operation, is it not?
Well manually you CAN use the Organizer to move fields so that is less
dramatic.

The other workaround is run the macro defining the field each time the user
opens a project; in such a way all his files get "infected" with the field
one at the time.

You can always call Microsoft of course but I do not know which would be the
priority this gets :)
 
D

Dean

Jan
Thanks. Moving the fields manually isn't a good option. I want to email the
user a project file or template, which will do that without direct
intervention. "Infecting" the user's files each time they start-up would mean
that I'd need to copy or create that a start-up event, which I couldn't do
when I tried in Project 2000. It's somewhat the same problem. At this point,
it doesn't look like there is a work-around. Let me be the first to know if
you think or learn of something.
 
J

Jan De Messemaeker

Hi,

In Project 2000 any procedure called Auto_Open and stored in the Global will
fire each time a project is opened.
HTH
 
D

Dean

Jan
The problem I ran into before is how do you move the Auto_Open procedure
into the Global template. Can you point to any code examples?
 
J

Jan De Messemaeker

Hi,

The way I solved this:
Put the Auto_Open in a file that all have access to
Make it copy itself (the module) to the global when opened
Ask the people to open this file once

I went further in that when the file changes the user's global will detect
that and download the new version.. quite some development.
HTH
 

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