View Single Post
  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields,microsoft.public.access
Graham Mayor Graham Mayor is offline
external usenet poster
 
Posts: 19,312
Default Create Mail Merge List/Database in Access 2007

See http://www.gmayor.com/mail_merge_graphics.htm

--

Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org


Tom Wickerath wrote:
This reply to an existing thread in microsoft.public.access
cross-posted to microsoft.public.word.mailmerge.fields. For those
people in the mailmerge.fields group, who are seeing only this
portion, the original thread can be found he

http://www.microsoft.com/office/comm...4-57b8de2b8f8d

====================================

Hi Renee,

I've spent hours trying, but so far I have not had any luck getting
this to work correctly. I posted a request for help from other MVPs
in Word and Access, and got three responses from Word MVPs. I've
tried all of these responses, but still no joy. Here are the
responses that I received:

=================================
First respondent

In this case, from what the OP posted, I would say that she has
probably typed the {} around the INCLUDEPICTURE field, rather than
using the special field braces you can insert using ctrl-F9.

However, you also have to:
a. either double up all the backslashes in the path name, or use
forward slashes

b. uncheck Word Tools-Options-General-Web options-Files-Update
links
on save - otherwise, when you save the mail merge main document, the
included field is unlinked, leaving a URL-style path with %20s
instead of spaces, and so on.

c. select the output document and refresh all the INCLUDEPICTURE
fields using F9. (You may find printing directly works, or you may
have to set either or both of Word Tools-Options-Print-Update
fields and Update links.

My experience is that it is also very easy to insert a space that
should not be there at the beginning of the file path name, e.g. using

{ INCLUDEPICTURE " { MERGEFIELD myfield }" }

=================================
Second respondent

I'm no expert with this stuff but the double backslashes are
critical. AFAIK you can't do it in the merge itself (although you
could probably manage it in a MailMergeAfterRecordMerge (or maybe
MailMergeAfterMerge) Application event) and it would be better if you
had a query in your database containing them, on which you could base
the merge - unfortunately, again, I don't think this is as easy as it
might be. You really need to use the VBA Replace(Photo,"\","\\")
function but it doesn't exist as an Access function so you will need
to build your own (rather trivial) VBA function and use that in your
query.

=================================
Third respondent

What I find works best is to use Insert | Picture | From File: Link
to File to insert a "known-good" path in the IncludePicture field,
then base my merge syntax on that. Also, if all the pictures are in a
single folder, you can type the entire path except for the actual
image filename as part of the field, putting just the image filename
in the merge field.

=================================

Here are my comments back to each person who provided help:
To the first respondent:
Thank You very much for your input. On the issue of typing the {},
that's exactly what I was attempting to do. At the time, I was kind of
wondering about this, thinking it might be more like an array formula
in Excel, but since Cindy didn't mention it on her web page...

To the second respondent:
Thank You Tony for your input. Actually, Access does have the Replace
function available. I believe it was added in Access 2000. Prior to
that, folks would code their own replace function, but I imagine that
likely wouldn't work since the mail merge functionality is not running
msaccess.exe to actually run such a function. One can call this
function directly from a query, but only if Sandbox mode is not
enabled for
Access.
++++++++
However, since writing the above comment back to the second person, I
have since discovered that Word Mail Merge does not want to display a
SELECT query if it contains a reference to a built-in function, such
as the Replace function. So, I ended up manually editing the paths in
my database to include the double slashes separating the folders.
Still no joy.

Perhaps it would be a lot easier to just use Access as your report
writer!

Tom Wickerath
Microsoft Access MVP
https://mvp.support.microsoft.com/profile/Tom
http://www.access.qbuilt.com/html/ex...tributors.html
__________________________________________

"Renee B." wrote:

I wasn't able to get it to work. I ended up getting the address
with the coding instead of the picture. I added the path name to the
DB as instructed and then went into Word to do the mail merge.

The input was

«AddressBlock»


{ IncludePicture "«PropertyPic»" }


which resulted in


Jane Doe
1234 5th St
SUNRISE, FL 33322


{ IncludePicture "xxxx SHADY GLEN DR.jpg" }


Any suggestions?