View Single Post
 
Old 07-28-2012, 02:14 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit 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 okiegirl,

Some comments:
1. Mergefields are really only for use in a mailmerge, where they get data directly from a mailmerge datasource.
2. The syntax for a mergefield embedded in an INCLUDEPICTURE field would be either:
{INCLUDEPICTURE "{MERGEFIELD Photo1}.jpg" \d}
if the mergefield includes the path (which needs to includes double backslashes as the separators, or:
{INCLUDEPICTURE "C:\\Users\\FilePath\\{MERGEFIELD\"Photo1\"}.j pg" \d}
if the mergefield does not include the path.
3. If you're trying to insert the picture with a link via vba, you would need to have 'LinkToFile:=True'. Fields aren't required for this.
4. I note you're now using a Selection as the destination for the inserted picture. If you use a range object (eg pointing to a bookmark or a cell in a specified table), you don't need to select it beforehand. Furthermore, if the table cell has fixed dimensions, the inserted picture will automatically be constrained to fit the cell's size, maintaining the correct aspect ratio. In that case, you wouldn't need to code for sizing the shape.
5. The way you're using the 'Picture' bookmark doesn't allow for the picture to be changed. Any attempt to update it will result in multiple pictures.

PS: When posting code, please use code tags (on the 'Go Advanced' tab).
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote