Steven H was telling us:
Steven H nous racontait que :
I neet to SET the value. It looks like that is not supported
Have you looked at the online help for the code I suggested
(CustomDocumentProperties)?
CustomDocumentProperties Property
Returns a DocumentProperties collection that represents all the custom
document properties for the specified document.
expression.CustomDocumentProperties
expression Required. An expression that returns one of the objects in the
Applies To list.
Remarks
Use the BuiltInDocumentProperties property to return the collection of
built-in document properties.
For information about returning a single member of a collection, see
Returning an Object from a Collection.
Example
This example inserts a list of custom built-in properties at the end of the
active document.
Set myRange = ActiveDocument.Content
myRange.Collapse Direction:=wdCollapseEnd
For Each prop In ActiveDocument.CustomDocumentProperties
With myRange
.InsertParagraphAfter
.InsertAfter prop.Name & "= "
.InsertAfter prop.Value
End With
Next
This example adds a custom built-in property to Sales.doc.
thename = InputBox("Please type your name", "Name")
Documents("Sales.doc").CustomDocumentProperties.Add _
Name:="YourName", LinkToContent:=False, Value:=thename, _
Type:=msoPropertyTypeString
So, if you can create it, you can certainly change the value, as exemplified
in the following:
Dim strName As String
strName = InputBox("Please type your name", "Name")
With ActiveDocument
.CustomDocumentProperties.Add "YourName", False, _
msoPropertyTypeString, strName
MsgBox .CustomDocumentProperties("YourName").Value
.CustomDocumentProperties("YourName").Value = "New Name"
MsgBox .CustomDocumentProperties("YourName").Value
End With
--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site:
http://www.word.mvps.org