Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-07-2014, 01:02 PM
ChrisBrewster ChrisBrewster is offline DocProperty vs DocVariable Windows 7 64bit DocProperty vs DocVariable Office 2010 64bit
Advanced Beginner
DocProperty vs DocVariable
 
Join Date: Jan 2014
Posts: 36
ChrisBrewster is on a distinguished road
Default 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?
Reply With Quote
  #2  
Old 02-07-2014, 02:09 PM
ChrisBrewster ChrisBrewster is offline DocProperty vs DocVariable Windows 7 64bit DocProperty vs DocVariable Office 2010 64bit
Advanced Beginner
DocProperty vs DocVariable
 
Join Date: Jan 2014
Posts: 36
ChrisBrewster is on a distinguished road
Default

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
Reply With Quote
Reply



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
DocProperty vs DocVariable Trying to Reference a ContentControl Using DocProperty SuzeG Word VBA 4 12-17-2013 03:40 PM
DocProperty vs DocVariable Calculate the coordinates of a DocVariable, Bookmark or paragraph. MaxInCO Word VBA 5 12-11-2013 03:28 PM
DocProperty vs DocVariable DOCVARIABLE copy paste special cyndor Word 2 04-06-2012 03:57 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:35 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft