Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-06-2016, 04:24 PM
macropod's Avatar
macropod macropod is offline Access Document Property that appears in Panel but cannot find using VBA Windows 7 64bit Access Document Property that appears in Panel but cannot find using VBA 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
 

Tags
document properties



Similar Threads
Thread Thread Starter Forum Replies Last Post
Access Document Property that appears in Panel but cannot find using VBA Userform and Document Information Panel 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
Access Document Property that appears in Panel but cannot find using VBA Access to the property of the current table b0x4it Word VBA 2 05-26-2011 06:25 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:07 PM.


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