![]() |
|
#1
|
|||
|
|||
![]()
Hi, I am making "mail merge to email" with .html document created by word.
Besides the normal email text, I have a centered table where I would like to place an image, that will change for every merged record. This image, in on my web server, so I need: the "image url" and the "image link to". Ex: On the server, I have 3 images: http://www.domain.com/images/banner1.png http://www.domain.com/images/banner2.png http://www.domain.com/images/banner3.png On my merge, I have 3 records, so I will be merging 3 emails. I need that on each email, a different image appears when they open their messages. I would like to have the 3 image urls stored also on the merge database. I have tried already this, but only the url shows when I open the message, not the image. can please someone help? Regards. |
#2
|
||||
|
||||
![]()
Hi ginelli,
Your image links return a 404 (not found) error. To embed an image in a document via mailmerge, you need to enclose the mailmerge field in an INCLUDEPICTURE field. Depending on your data setup, a field construction like the following can be used: {IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\«Image»"} \d}} or {IF {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\{MERGEFIELD Image}"} \d} {INCLUDEPICTURE {IF TRUE "C:\Users\My Document Path\Pictures\{MERGEFIELD Image}"} \d}} After running a mailmerge coded this way, you'll have the correct, unlinked image for each record. If the filepath for the images is held in the mailmerge data source, you could use: {IF {INCLUDEPICTURE {IF TRUE "«FilePath»\«Image»"} \d} {INCLUDEPICTURE {IF TRUE "«FilePath»\«Image»"} \d}} or {IF {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Image}"} \d} {INCLUDEPICTURE {IF TRUE "{MERGEFIELD FilePath}\{MERGEFIELD Image}"} \d}} Note: You need a path separator between the filepath mergefield and the image mergefield. If that separator is included in the source data, it can be omitted from the field above construction but leaving it there has no adverse effects either. If the path data are included with in the image field, you can use: {IF {INCLUDEPICTURE {IF TRUE «Image»} \d} {INCLUDEPICTURE {IF TRUE «Image»} \d}} or {IF {INCLUDEPICTURE {IF TRUE {MERGEFIELD Image}} \d} {INCLUDEPICTURE {IF TRUE {MERGEFIELD Image}} \d}} Note: The field brace pairs (ie '{ }') for the above examples are created in the body of the document via Ctrl-F9 (Cmd-F9 on a Mac) - you can't simply type them or copy & paste them from this message. Likewise, you can't type or copy & paste the chevrons (ie '« »') - they're part of the actual mergefields, which you can insert from the mailmerge toolbar.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
|||
|
|||
![]()
Hi Paul, great stuff, thanks.
Two things: - the images url I sent you, are examples, so it's normal they give an error; - everything works on word, when I "save as" a web template, it stops working. Can you please help? Regards, Luis |
#4
|
||||
|
||||
![]()
Why would you save a mailmerge main document as a web template? That makes no sense at all. Mailmerge main documents should be used as mailmerge main documents, not saved as templates of any kind.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#5
|
|||
|
|||
![]()
Hi Paul, the reason why I have save the document as a "web page" is to have more formatting flexibility. I need to send this template as an html email message.
My main problem with the source code you sent me, is that I get a square imagem on the document and I cannot place the image inside the document with it's original dimensions: 560px with x 100px height. Do you have a solution for this under word, so I won't have to go to the .html? |
#6
|
||||
|
||||
![]()
IIRC, sending an email in html format doesn't require the mailmerge main document to be saved in the same format. In any event, you cannot rely on the recipients viewing HTML emails in that format or that they will appear the same on their PCs as they do on your's.
Ordinarily, you can constrain an image's dimensions by inserting it into a table cell whose height and width are fixed to those dimensions. I assume that works with mailmerges too.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#7
|
|||
|
|||
![]()
Hi Paul, that's exactly what I tried and didn't managed to solve, do you believe you can do your own experience and let me know about a possible solution?
Regards, Luis |
#8
|
||||
|
||||
![]()
I've tested and confirmed that using the approach I outlined in post #6 works for image size constraint with a mailmerge. All you need to do, then, is to construct such a table and place the mergefield within it.
PS: It's easier to work with the INCLUDEPICTURE fields if you keep the document in .doc format, not .docx.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#9
|
|||
|
|||
![]()
Hi Paul, sorry to insist, but I have tried what you told me, I have converted my image size from pixels to inches (560px with x 100px height ==> 5.83" with x 1.04" height.
It works for the first and actual record, but as soon as I push the button to skip for the next record, the image gets again unformatted for a square of 3" by 3". I have used .doc word format a a simple blank test page, with an inserted table on it. |
#10
|
||||
|
||||
![]()
Are you executing the merge, or just previewing it?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#11
|
|||
|
|||
![]()
oopsss... you're right! I was only previewing it... it worked, thanks a lot! I will do my final tests on the template I need and I shall keep you posted.
Regards, Luis |
#12
|
|||
|
|||
![]()
Hi Paul, have you seen my last post and request?
Now I need to add an hyperlink to the image, but also along the mail merge solution. Do you have any idea how this can be done? Regards, Luis |
#13
|
|||
|
|||
![]()
Hi Paul, it worked just fine, thank you very much. I used the .docx and it worked.
Now, I need one last thing... ![]() |
#14
|
||||
|
||||
![]()
Hi Luis,
You need both the image and a hyperlink to it? Since you apparently want different hyperlinks, you can't simply insert a mailmerge field into a hyperlink field. By default, if you insert a mailmerge field into a hyperlink field, the hyperlinks will all show the first record’s address as the 'Text to display' text. Here's how you can do get a mailmerge to display your preferred default 'Text to display' text instead: 1. Disregarding mergefield issues for the moment, insert a hyperlink into the document in the normal way, choosing whatever 'Click Here' text you want in the 'Text to display' box. 2. Select the inserted hyperlink and press Shift-F9 to expose its field code. 3. Replace everything in the field after 'HYPERLINK' with your mergefield. 4. Select the field and press F9 to update the display. In Word 2007 & later, you can make the display text variable also, by following these additional steps: 5. Position the cursor anywhere within the display text. 6. Insert a mergefield pointing to whatever data field you want to use for the display text (this could even be the same field as used at step 3 above). 7. Delete all of the previous display text either side of your last-inserted mergefield (note that this field will likely have updated already). 8. Execute the merge. 9. After merging to a new document, use Ctrl-A, F9 to update all fields. Without this, the mergefield hover text won’t update to the correct targets.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#15
|
|||
|
|||
![]()
Hi Paul,
I have made already a few tests, without success. Just to make sure I understood it right: - on my mailmerge, I have 10 records, each one will use a different image and I have the image url already on the data base and has a merge field; - for each one of these 10 images, I need also a different url hyperlink From your last answer, I assume this is not possible, true? Please note I am mailmerging always to e-mail, not to other blank document. Regards, Luis |
![]() |
Tags |
email, html, mail merge |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
Mail Merge won't email | QEDDave | Mail Merge | 11 | 10-29-2014 09:44 PM |
![]() |
Baldeagle | Mail Merge | 8 | 05-11-2012 02:56 AM |
Outllook & Word '07 - can't mail-merge email | chayden | Outlook | 5 | 10-08-2011 06:58 AM |
Convert mail merge to PDF then email | TeriJean | Mail Merge | 0 | 10-04-2011 03:52 PM |
Mail Merge via Proxy Email? | ghillie30 | Mail Merge | 0 | 07-08-2011 06:26 AM |