Macros & Custom Properties

D

Dealiah

I'm having difficulty getting my macros to recognize custom properties. I'm using the following: Rendered = Active.Document.CustomProperties(wdPropertyDateCompleted) which is a custom property for the document I'm working on that I'm trying to sort and list as being "rendered". Help!
 
J

Jezebel

What version of Word are you using?




Dealiah said:
I'm having difficulty getting my macros to recognize custom properties.
I'm using the following: Rendered =
Active.Document.CustomProperties(wdPropertyDateCompleted) which is a custom
property for the document I'm working on that I'm trying to sort and list as
being "rendered". Help!
 
J

Jezebel

In that case, 1) the document has no "CustomProperties" -- do you mean
CustomDocumentProperties ?

2) where does wdPropertyDateComplete come from? it looks like one of Word's
built-in numeric constants, but it isn't; and in any case
CustomDocumentProperties normally takes a string argument.

Where does this code come from?
 
D

Doug Robbins - Word MVP

Hi Dealiah,

There should not be a period between Active and Document, and the feature is
CustomDocumentProperties. Look that up in the visual basic help file to see
how to use it.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
Dealiah said:
I'm having difficulty getting my macros to recognize custom properties.
I'm using the following: Rendered =
Active.Document.CustomProperties(wdPropertyDateCompleted) which is a custom
property for the document I'm working on that I'm trying to sort and list as
being "rendered". Help!
 
D

Dealiah

The document that I'm setting up a macro to extract information contains a custom document property which is listed as "Date completed". I'm trying to pull that information out and put it and other information into a table form. I'm afraid I'm way over my head, but my boss wants me to try it. Any help you can give would be greatly appreciated!
 
J

Jezebel

Dealiah said:
The document that I'm setting up a macro to extract information contains a
custom document property which is listed as "Date completed". I'm trying to
pull that information out and put it and other information into a table
form. I'm afraid I'm way over my head, but my boss wants me to try it. Any
help you can give would be greatly appreciated!

The code to retrieve the property will look something like this:

Dim pDate as date

pDate = Activedocument.CustomDocumentProperties("Date Completed")
ActiveDocument.Tables(1).Cell(1,1) = format(pDate, "yyyy-mm-dd")

But the smart answer is to tell your boss not to be an idiot. If he wants
you to write VBA code he has to pay for the training. The Nike approach just
doesn't work with software.
 

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