View Single Post
 
Old 06-08-2015, 10:44 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,366
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

You can create & update any custom document properties you might require with code like:
Code:
Dim StrClient As String, StrAddr As String
StrClient = "Client Name": StrAddr = "Client Address"
With ActiveDocument
  With .CustomDocumentProperties
    On Error Resume Next
    .Add Name:="Client Name", Type:=msoPropertyTypeString, LinkToContent:=False, Value:=StrClient
    .Item("Client Name").Value = StrClient
    .Add Name:="Client Address", Type:=msoPropertyTypeString, LinkToContent:=False, Value:=StrAddr
    .Item("Client Address").Value = StrAddr
  End With
End With
Simply replace "Client Name" and "Client Address" in the above code with references to the appropriate textboxes on your userform.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote