Associating non-native properties with ActiveDocument

K

KevinC

I want to establish a set of properties that are not native to Word objects and associate them with the ActiveDocument. I'd like to be able to set and get those properties either from VBA within Word or through an ActiveX interface (e.g. "setMyID(123)" and "getMyID()"). I have experience controlling Word via ActiveX, but I have never seen anything like this. Does anyone know if it's possible to do this? If so, how?
 
J

Jezebel

You can use DocumentProperties or DocVariables for this purpose.

MyDoc.CustomDocumentProperties.Add "MyID" ...
and
ID = MyDoc.CustomDocumentProperties("MyID")

DocumentProperties are also accessible to the user (File > Properties >
Custom).

DocVariables function in much the same way, but can be changed only through
code.



KevinC said:
I want to establish a set of properties that are not native to Word
objects and associate them with the ActiveDocument. I'd like to be able to
set and get those properties either from VBA within Word or through an
ActiveX interface (e.g. "setMyID(123)" and "getMyID()"). I have experience
controlling Word via ActiveX, but I have never seen anything like this.
Does anyone know if it's possible to do this? If so, how?
 
Top