Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 02-11-2013, 11:25 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Post Mail Merge to email, changing images on email layout

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.
Reply With Quote
  #2  
Old 02-11-2013, 04:30 PM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 02-13-2013, 12:27 PM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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
Reply With Quote
  #4  
Old 02-13-2013, 04:49 PM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #5  
Old 02-14-2013, 09:09 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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?
Reply With Quote
  #6  
Old 02-14-2013, 03:00 PM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #7  
Old 02-15-2013, 03:44 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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
Reply With Quote
  #8  
Old 02-15-2013, 03:58 AM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #9  
Old 02-15-2013, 05:32 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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.
Reply With Quote
  #10  
Old 02-15-2013, 05:49 AM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Are you executing the merge, or just previewing it?
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
  #11  
Old 02-15-2013, 06:02 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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
Reply With Quote
  #12  
Old 02-15-2013, 10:45 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

Hi Paul, it worked just fine, thank you very much. I used the .docx and it worked.
Now, I need one last thing... ... the link on the image! Is there any source code that I should also add to it?
Reply With Quote
  #13  
Old 02-19-2013, 08:51 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

Quote:
Originally Posted by macropod View Post
Are you executing the merge, or just previewing it?
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
Reply With Quote
  #14  
Old 02-19-2013, 04:06 PM
macropod's Avatar
macropod macropod is offline Mail Merge to email, changing images on email layout Windows 7 64bit Mail Merge to email, changing images on email layout Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,956
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #15  
Old 02-22-2013, 10:12 AM
ginelli ginelli is offline Mail Merge to email, changing images on email layout Windows 7 32bit Mail Merge to email, changing images on email layout Office 2010 32bit
Novice
Mail Merge to email, changing images on email layout
 
Join Date: Feb 2013
Posts: 11
ginelli is on a distinguished road
Default

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
Reply With Quote
Reply

Tags
email, html, mail merge

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Mail Merge won't email QEDDave Mail Merge 11 10-29-2014 09:44 PM
Mail Merge to email, changing images on email layout Mail Merge to Email via Outlook Express 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

Other Forums: Access Forums

All times are GMT -7. The time now is 08:40 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft