Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How do you set/change .doc properties from VBA 1

Status
Not open for further replies.

cresbydotcom

Technical User
May 22, 2006
234
The record macro function leaves no appropriate code to change the "properties" set that read in a pop-up when you hover in Winexplorer.

Variables/object.properties that can be found don't seem to do anything. And Sendkeys fails in dialogs.

I use macros to generate docs (purchase orders) that externally look like the next one, the pop-up properties is a nice way to identify specifics but a slow process to generate manually.

Any ideas anyone?
 
Code:
ActiveDocument.BuiltInDocumentProperties(wdPropertyComments).Value = "Yadda yadda"
will display "Yadda yadda" in the Windows Explorer popup.

faq219-2884

Gerry
My paintings and sculpture
 
Seems to work - eventually.

The problem may have been the properties do not register until you exit the doc.

Saving does not do it until you exit. Isn't M$ wonderful?

I may very well have tried the same code and failed for this reason - I spent enough time on permutations of similar kind.
 
In fact, I think that more generally the explorer doesn't read the properties of an open (locked ?) document.

Hope This Helps, PH.
FAQ219-2884
FAQ181-2886
 
It is worse than that.

Say you put the mouse over the file in Explorer and get the popup with "Yadda yadda".

Now open the file in Word.

Go look at the file again in Explorer. You will NOT get the "Yadda yadda" in the popup.

Change the property to "Zippity do dah". You will NOT get it in the popup.

Save the file. You will NOT get it in the popup.

Close the file. The popup will now be "Zippity do dah."

Explorer does not read/display any existing properties of an open file.

faq219-2884

Gerry
My paintings and sculpture
 
Thanks

It is not a problem once you know what you are dealing with! Knowing enough is the real problem. Mine anyway.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top