Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / October 2003

Tip: Looking for answers? Try searching our database.

RE: docproperty

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Colin Martin - 12 Oct 2003 03:24 GMT
Hi I am tring to populate some word cells using the prps
in my access code.  To do this I need to name the
docpropery with the same name as the cells in Access.  The
code for the doc property is:

{Doc Property "OrderId"\*MergeFormat}

In Insert / Field / DocumentInformation / DocProperty, I
can not seem to find how one can add new Field Properties
to the DocProperty

Could anyone please help
Many thanks
Colin
Peter Jamieson - 12 Oct 2003 08:47 GMT
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
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.