View Single Post
  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Link excel table inside a condition

You can use VBA and Word's MailMerge events to modify the Mail Merge Main
Document before each record is merged (MailMergeBeforeRecordMerge event).

The Word VBA has some info. on how to use events if you haven't done that
before, and you might find Doug Robbins' Addin on Graham Mayor's site at
http://www.gmayor.com/individual_merge_letters.htm useful as an example.

Peter Jamieson

"Alex St-Pierre" wrote in message
...
Hi Peter,
I'm wondering if there's a way to make a merge with a macro and update the
link before each record?
Thanks!
Alex
--
Alex St-Pierre


"Peter Jamieson" wrote:

Your best bet is probably to have a blank 1-pixel graphic (let's say it
is
in sheet "blank" and do something like

{ IF A = B "No Graphic" "Graphic below
" }{ LINK Excel.Sheet8 "\\\\pathpath\\file.xls" "{ MERGEFIELD sheet }" \a
\p }

if the sheet column contains "blank" when you want the blank graphic, or

{ IF A = B "{ SET mysheet "blank" }No Graphic" "{ SET mysheet "{
MERGEFIELD
sheet }" }Graphic below
" }{ LINK Excel.Sheet8 "\\\\pathpath\\file.xls" "{ MERGEFIELD sheet }" \a
\p }

if the sheet column doesn't contain anything you can rely on.

I don't know if that will work but it is what I would try.

Peter Jamieson

"Alex St-Pierre" wrote in
message
...
Hi !
I use a mailmerge to produce 1, 2, or 3 graphics for each line of
record.
I
have an excel file that contains 1 graphic per sheet. The name of the
sheet
is store inside {MERGEFIELD1}. After the merge, the path of each
graphic
must
stay variable to be able to update the document for each graphic
(ctrl-A +
F9).
When I do this, all link stay in text after after the merge (work fine)
{ LINK Excel.Sheet8 "\\\\pathpath\\file.xls" "{ MERGEFIELD1 }" \a \p }
When I put the same thing inside a condition, the link MERGEFIELD1
disapear
inside the merged file.
{ IF A=B "No Graphic" "Graphic below:
{ LINK Excel.Sheet8 "\\\\pathpath\\file.xls" "{ MERGEFIELD1 }" \a \p }
"}
So, I only see the table result. Since there is no link, all tables are
identical for each record (cannot update it) Is the a way to stay the
link
variable when the table link is used inside a condition ?
Thanks!
Alex
--
Alex St-Pierre