Posted to microsoft.public.word.docmanagement
|
|
Importing information from contacts to word
Great, thanks for your help
God Bless
Graham Mayor wrote:
Yes of course.If you look at the longer example to automate letters, then
you will see that the required fields are each extracted separately eg
strCompany = "{PR_COMPANY_NAME}"
strAddress = "PR_POSTAL_ADDRESS"
strSubject = ""
strFax = "PR_BUSINESS_FAX_NUMBER"
'Let the user choose the contact from Outlook
'And assign the required components to variables
strAddress = Application.GetAddress("", strAddress, _
False, 1, , , True, True)
If strAddress = "" Then
MsgBox "User cancelled or no address listed", , "Cancel"
Exit Sub
End If
strCompany = Application.GetAddress("", strCompany, _
False, 2, , , True, True)
strFax = Application.GetAddress("", strFax, _
False, 2, , , True, True)
You can extract as many or as few of the available fields as you want. You
can then write those variables at the cursor and you can place the cursor eg
by inserting bookmarks in the document and seeking the bookmark before
writing the content of the variable.
eg
Selection.GoTo What:=wdGoToBookmark, Name:="CompanyName"
Selection.TypeText strCompany
Selection.GoTo What:=wdGoToBookmark, Name:="FaxNo"
Selection.TypeText strFax
--
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
pbscott wrote:
Thanks for the info, it has helped and have been able to use.
Is it possible though to put the fax number somewhere else within the
document, away from the Company name etc,.
Graham Mayor wrote:
Did you read the link I posted earlier which explains how to do that?
http://www.gmayor.com/Macrobutton.htm
--
Graham Mayor - Word MVP
My web site www.gmayor.com
Word MVP web site http://word.mvps.org
pbscott wrote:
No I only want details in a single document, want the verious parts
placed in bookmarks, mainly the name and fax number
Beth Melton wrote:
It sounds like what you want is Mail Merge. You would use merge
fields instead of bookmarks in your Word document.
You can start your merge from Outlook by opening your Contacts view
and going to Tools/Mail Merge. Here's an article that will provide
you with some additional steps and information:
http://office.microsoft.com/en-us/as...733971033.aspx
Please post all follow-up questions to the newsgroup. Requests for
assistance by email can not be acknowledged.
~~~~~~~~~~~~~~~
Beth Melton
Microsoft Office MVP
Office 2007 Preview Site:
http://www.microsoft.com/office/preview/default.mspx
Office 2007 Community Articles/Tutorials:
http://www.microsoft.com/office/prev...e_archive.mspx
TechTrax eZine: http://mousetrax.com/techtrax/
MVP FAQ site: http://mvps.org/
"pbscott" wrote in message
ups.com...
I would like to import details from my contacts list. ie. name to
a bookmark, address to a bookmark, fax to a bookmark etc. within
word
asnd clues ould help,
Thanks
|