View Single Post
 
Old 02-01-2014, 08:30 PM
macropod's Avatar
macropod macropod is offline Windows 7 32bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,467
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

I'm not sure what your first code block has to do with add a DOCPROPERTY field to a document. The correct syntax to add a DOCPROPERTY field is:
Code:
ActiveDocument.Fields.Add Range:=Selection.Range, Type:=wdFieldEmpty, _
  Text:="DOCPROPERTY  FirstTest1Custom", PreserveFormatting:=True
Note that you'll get an error output if the FirstTest1Custom Custom Document Property doesn't exist.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote