Problems reading Custom Properties with word Macro

I

ILoveInternet

Hi

I have a problem with custom properties and macros in word. I'm
working with a system that keeps track of different versions of word
documents, and the system writes to custom properties each time a new
version of the document is sent to the system.

The documnets have a Macro that reads the Custom Properties and
updates fields in the document header and footer. My problem is that
the macro sometimes dissapaers and so does the Custom Properties. I'm
haven't worked with Macros much, and I do not know where to start. All
clients are using Office XP, and they do allow Word to run Macros.

Is there something I have to look for when I use Macros to read Custom
Properties? Do I have to turn on a special setting? Anything??? I'm
desperate!!

/Emil
 
J

Jezebel

Can you explain about the macro and properties disappearing? Macros can be
disabled (through security settings), but they don't disappear unless
someone is deleting them. Properties don't disappear either unless someone
is deleting them -- you might consider using Document Variables instead:
these behave in essentially the same way and you can use them in fields, but
they are otherwise hidden from the user.
 
I

ILoveInternet

Hello

The Marco is placed in a .dot-file in a project and opened in the word
document. The word document then has the macro in the file and other
users do not have to have this .dot file to run the macro.
Macros can be
disabled (through security settings), but they don't disappear unless
someone is deleting them.
Is it possible that a anti-virus program can detect the macro and ask
the user if he/she wants to remove it, or are the macros always
disabled?
you might consider using Document Variables instead:
these behave in essentially the same way and you can use them in fields
Can you access the Document Variables from VB or ASP? And do I need
Marcos to update the fields???

Thanks
Emil
 
I

ILoveInternet

Hello

I have my macro in a .dot file which is a template to the word
document that my customer uses in my system. The Macro updates fields
in the footer in the document. The custom properties are set with the
DSOleFile.PropertyReader object. I never remve a property, only add or
update. Thats why I suspect that they disappeare when a user has the
wrong kind of settings in word.

Is it possible that Word removes a Custom Property due to a setting?

Is it possible that Word removes a Macro? Does Word always only
disable a macro if you do not allow macros, or can you set the
security to automatically remove all macro/custom properties.

Is it possible that a anti-virus program removes a macro (they are
always downloaded from a browser)? I think anit-virus usually
quaranteen/locks the file, and not remove macros.

You mention Document Variables, can they be set from out side of word?
Can they update fields without macros? Can I use Document Variables in
other file-formats than word?


Thanks
Emil
 
C

Cindy M -WordMVP-

Hi ILoveInternet,
The Marco is placed in a .dot-file in a project and opened in the word
document. The word document then has the macro in the file and other
users do not have to have this .dot file to run the macro.
This is an incorrect assumption. If the macro is in the DOT file, it
remains in the .dot file and is not transferred to the document. So
every user who uses a document created from the *.dot file must also
have access to the *.dot file in order for the macro to run/be
available.

Furthermore, you don't show us the code that works with the custom
document properties. Depending on how the macro is addressing the
properties, it's quite possible that it's actually manipulating the
properties in the *.dot file, rather than in the document, itself?

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 

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