You have to add the docproperty to the CustomDocumentProperties collection.
This has nothing to do with the fields collection.
e.g.
Dim oDoc as Word.Document
Dim strOrderID
' set up oDoc and the value of strOrderID before you get here
With oDoc
On Error Resume Next
.CustomDocumentProperties("OrderID").Delete
Err.Clear
On Error GoTo 0
.CustomDocumentProperties.Add _
Name:="OrderID", _
LinkToContent:=False, _
Value:=strOrderID, _
Type:=msoPropertyTypeString
End With
End Sub
Then you can insert the DOCPROPERTY field as you are doing already (but
DOCPROPERTY should be one word).
--
Peter Jamieson
MS Word MVP
> Hi I am tring to populate some word cells using the prps
> in my access code. To do this I need to name the
[quoted text clipped - 10 lines]
> Many thanks
> Colin