![]() |
#2
|
||||
|
||||
![]()
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 Code:
Sub Demo() SetStatusProperty ActiveDocument, "Status", "ABC" MsgBox ActiveDocument.CustomDocumentProperties("Status").Value End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
document properties |
Thread Tools | |
Display Modes | |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
jkimwardtech | Word VBA | 1 | 01-21-2016 06:53 PM |
Vba code to save document as pdf using document property text and rename folder. | staicumihai | Word VBA | 1 | 12-21-2015 07:39 AM |
Document Property Question | ksigcajun | Word VBA | 9 | 10-14-2014 11:26 AM |
Cannot access most of property of MailItem object on Windows Server 2008 64 bit | tz900 | Outlook | 0 | 04-10-2012 12:55 PM |
![]() |
b0x4it | Word VBA | 2 | 05-26-2011 06:25 AM |