IncludePicture - File extensions

N

NickH

Hi

I have a word template with the following Expression

{Includepicture "{MERGEFIELD Description}"\d}
When the Mergefield is updated the corresponding string
is displayed. C:\\Temp\\plt1.wmf"\d}

This works fine, I have a table with a
field "Description" within Access which holds the
information on retrieving the Graphics image from its
location, which is does correctly.

What I would like to do if it is possible is to add/store
to this table other descriptions of different file
formats i.e jpg format. Then using another template using
something very similar to the expression given above is
to extract only those graphic images with the "jpg"
format.

Therefore, I would have two templates one for "Wmf"
images to be merged, and the second template for
the "jpg" images to be merged.

If this is possibly, the one alternative is to have a
separate table in Access for holding the names and path
for the "jpg" images.

Any help would be most appreciated.


Tks

Nick
 
C

Cindy M -WordMVP-

Hi NickH,

I'm not sure I'm following you correctly...

are you basically asking whether you can do something like
this:

{ IncludePicture "{ Mergefield PathToGrafik }.jpg" \d }

IOW, have the graphic extension independent of the rest of
the graphic path and name?

The answer is YES.
I have a word template with the following Expression

{Includepicture "{MERGEFIELD Description}"\d}
When the Mergefield is updated the corresponding string
is displayed. C:\\Temp\\plt1.wmf"\d}

This works fine, I have a table with a
field "Description" within Access which holds the
information on retrieving the Graphics image from its
location, which is does correctly.

What I would like to do if it is possible is to add/store
to this table other descriptions of different file
formats i.e jpg format. Then using another template using
something very similar to the expression given above is
to extract only those graphic images with the "jpg"
format.

Therefore, I would have two templates one for "Wmf"
images to be merged, and the second template for
the "jpg" images to be merged.

If this is possibly, the one alternative is to have a
separate table in Access for holding the names and path
for the "jpg" images.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
N

NickH

Hi Cindy

Yes you are correct.

I have tried several expressions as the one given below
but without much success.

I have a table in access with two fields
with the following information

Number Description
1 C:\Temp\plt1.wmf
2 c:\temp\plt2.wmf
3 C:\temp\photo1.jpg
4 C:\temp\photo2.jpg

The general idea is to use two templates with appropriate
expressions to merge the specific Graphics image using
one table with access as shown above.

At the present time all I have been able to achieve is
merging both "Wmf" and "jpg" graphic images to the same
new word document(Catalogue).

So any help here I would be most appreciated.


tks

Nick
 
C

Cindy M -WordMVP-

Hi NickH,

I'm not really clear on everything, but if the following
information is what's coming across from the database, then
you have one major problem: the IncludePicture field
expects *double backslashes*. I'd expect you to be getting
error messages in the mail merge result document given the
data you list below.
I have tried several expressions as the one given below
but without much success.

I have a table in access with two fields
with the following information

Number Description
1 C:\Temp\plt1.wmf
2 c:\temp\plt2.wmf
3 C:\temp\photo1.jpg
4 C:\temp\photo2.jpg

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
N

NickH

Cindy

I have got the expression to work, by doing a merge and
then an Up-date I obtain all the graphic images into the
new document, expression given here:

{IncludePicture "{MERGEFIELD File}"/d}

If I toggle on {MERGEFIELD File}, the path and file look
like this

S:\\R&D\\EMC\\Product - Project Test\\icon\\Statoil
Kristin\\plt1.wmf

Therefore everything works, ok

My only question was the tabel in Access I use for the
Graphic images contains two types "wmf" and "Jpg", I was
wondering if it is possible to use a modified expression
which will allow me to pull out and merge into a merge
document one of the specified types of images. Therefore
I could have two templates, one for producing a document
with the "Wmf" images and the other template to produce a
document with the "Jpg" images.

Tks

nick
 
C

Cindy M -WordMVP-

Hi NickH,

Ummmm. OK, on re-reading this for the fourth time, I think
I'm finally following what you're asking. Chalk it up to the
intensive VB.NET course I've been immersed in for the last
three weeks :) Sorry about being so dense!

If this is all one field, and you don't want to add an
additional field to carry just that information, then you're
going to need QUERY expressions. Word fields don't have any
string manipulation capability, to speak of; and what little
they have is relatively complicated to set up.

What you'll do in the query expression is look at the last
four characters of the field content, and check if they
match *.wmf, or *.jpg, respectively. (You need to queries,
one for each type).

Set up a new query and take across all the fields you need
for the mail merge.

Now, in the first empty column, in the top row, enter the
expression, using this pattern:

ColumnHeading: Right([FieldName], 4)

Where ColumnHeading is the field name you'll see in the mail
merge setup and FieldName is the name of the field holding
the path to the graphics file.

In the "Criteria" row, type .wmf resp. .jpg
My only question was the tabel in Access I use for the
Graphic images contains two types "wmf" and "Jpg", I was
wondering if it is possible to use a modified expression
which will allow me to pull out and merge into a merge
document one of the specified types of images. Therefore
I could have two templates, one for producing a document
with the "Wmf" images and the other template to produce a
document with the "Jpg" images.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
N

NickH

Hello Cindy

I am a little bit late replying back to you,
reason being other work has stopped me looking at this
problem.
I will certainly try as you have suggested, I am also
very grateful for your patience and time.

tks

Nick
-----Original Message-----
Hi NickH,

Ummmm. OK, on re-reading this for the fourth time, I think
I'm finally following what you're asking. Chalk it up to the
intensive VB.NET course I've been immersed in for the last
three weeks :) Sorry about being so dense!

If this is all one field, and you don't want to add an
additional field to carry just that information, then you're
going to need QUERY expressions. Word fields don't have any
string manipulation capability, to speak of; and what little
they have is relatively complicated to set up.

What you'll do in the query expression is look at the last
four characters of the field content, and check if they
match *.wmf, or *.jpg, respectively. (You need to queries,
one for each type).

Set up a new query and take across all the fields you need
for the mail merge.

Now, in the first empty column, in the top row, enter the
expression, using this pattern:

ColumnHeading: Right([FieldName], 4)

Where ColumnHeading is the field name you'll see in the mail
merge setup and FieldName is the name of the field holding
the path to the graphics file.

In the "Criteria" row, type .wmf resp. .jpg
My only question was the tabel in Access I use for the
Graphic images contains two types "wmf" and "Jpg", I was
wondering if it is possible to use a modified expression
which will allow me to pull out and merge into a merge
document one of the specified types of images. Therefore
I could have two templates, one for producing a document
with the "Wmf" images and the other template to produce a
document with the "Jpg" images.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep
30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e- mail
:)

.
 

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