Populating word2007 documents from Outlook2007 Contacts

S

Sierk

I am upgrading some automation from 2003 to 2007 that was designed to
transfer contact information, like name and address, from an outlook contact
item and inserting it at a predetermined location in a new word document
template. Presently the program works up until the inserting the text-string
part. Thus it extracts the address data from outlook, it formats it into a
proper address block, it opens a document-template, it can even insert the
text at the beginning of the document.

I have spent the past couple of days trying to figure out a way to insert
the text in a specific location using VBA but I can't get it to work. If you
have done something like this please share what you did. Also include the
code so I don't have to waste time navigating the MS Help Maze to implement
your suggestion.
 
S

Sue Mosher [MVP-Outlook]

I'm confused. Are you saying that your code that worked for Office 2003
doesn't work in Office 2007? If so, please post the relevant code snippet.

Or, are you trying to add new functionality to an existing project? The old
way to insert data into a Word document created from a template is to include
bookmarks in the template to function as placeholders. You can then use the
Range.InsertAfter method, as shown in a code snippet at
http://www.outlookcode.com/article.aspx?ID=24 . The newer way is to use
content controls, but that gets a lot more complicated. I have a complete
walkthrough in my book, though, if you want to take a look.
 
S

Sierk

Thanks Sue,

As you observed I am adding some functionality. As far as the program goes,
I tried using content controls but found the "help" woefully inadequate.
Would you recommend going with the bookmarks or should I pursue using content
controls?
 
S

Sue Mosher [MVP-Outlook]

That depends on other goals you didn't mention. If you want a short-term
solution, use bookmarks. If you want a document where you have more control
over what users can enter where, look into content controls.
--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
S

Sierk

Thanks Sue,

I got the bookmark suggestion to work right away. I'll have to find out if
the powers at be want me to spent time playing around with content controls.
I looked into it before contacting the discussion forum, and did not get it
to work.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top