#1
|
|||
|
|||
DocProperty vs DocVariable
I started a thread about how two companies can share a document. I have another question about that. The other company originates the document, so I am trying to use their format as a starting point. I was going to use a lot of IF fields to toggle terms that switch between the two companies: {IF {DOCVARIABLE CompanyName}="Acme" "Star" "Meteor"} Problem: the other company's documents already have quite a few DocProperty fields that seem intended for this purpose. If it's OK to use DocProperties this way, I need to toggle them. I just tried writing a macro to do this, and could not record it. Does anyone know VBA to do this? |
#2
|
|||
|
|||
I found the answer to my question. DocProperties are set as follows (notice there are both built-in and custom properties):
Sub SetPropertiesAcme() With ActiveDocument .BuiltInDocumentProperties("Company").Value = "Acme" .CustomDocumentProperties("Product Name").Value = "Star" .Fields.Update End With End Sub |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Add text to DocProperty with VBA? | Hdata | Word VBA | 8 | 05-18-2014 04:12 PM |
DocVariable formatting and the ability to truncate a string. | MaxInCO | Word | 1 | 12-18-2013 05:35 PM |
Trying to Reference a ContentControl Using DocProperty | SuzeG | Word VBA | 4 | 12-17-2013 03:40 PM |
Calculate the coordinates of a DocVariable, Bookmark or paragraph. | MaxInCO | Word VBA | 5 | 12-11-2013 03:28 PM |
DOCVARIABLE copy paste special | cyndor | Word | 2 | 04-06-2012 03:57 AM |