View Single Post
 
Old 03-06-2016, 04:24 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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

Despite being listed, 'Status' is the name of a Custom Document Property that you'd have to add before you can populate it. For that, you can use code like:
Code:
Function SetStatusProperty(wdDoc As Document, StrProp As String, StrTxt As String)
Dim i As Long, bAdd As Boolean
bAdd = True
With wdDoc.CustomDocumentProperties
  For i = 1 To .Count
    If .Item(i).Name = StrProp Then
      .Item(StrProp).Value = StrTxt
      bAdd = False
      Exit For
    End If
  Next
  If bAdd = True Then .Add Name:=StrProp, LinkToContent:=False, Value:=StrTxt, Type:=msoPropertyTypeString
End With
End Function
which you can call with code like:
Code:
Sub Demo()
SetStatusProperty ActiveDocument, "Status", "ABC"
MsgBox ActiveDocument.CustomDocumentProperties("Status").Value
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote