Group:  Microsoft Word ยป microsoft.public.word.mailmerge.fields
Thread: Link excel table inside a condition

Geek News

Link excel table inside a condition
Alex St-Pierre 5/11/2007 3:16:01 PM
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
Re: Link excel table inside a condition
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 5/11/2007 4:31:30 PM
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" <AlexStPierre[ at ]discussions.microsoft.com> wrote in message
news:7E730687-8871-4F22-AC09-E6C11A02B1E6[ at ]microsoft.com...
[Quoted Text]
> 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

Re: Link excel table inside a condition
Alex St-Pierre 5/11/2007 5:19:02 PM
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:

[Quoted Text]
> 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" <AlexStPierre[ at ]discussions.microsoft.com> wrote in message
> news:7E730687-8871-4F22-AC09-E6C11A02B1E6[ at ]microsoft.com...
> > 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
>
Re: Link excel table inside a condition
"Peter Jamieson" <pjj[ at ]KillmapSpjjnet.demon.co.uk> 5/11/2007 6:46:30 PM
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" <AlexStPierre[ at ]discussions.microsoft.com> wrote in message
news:86CE2724-1DFB-412E-9339-132B20017CBD[ at ]microsoft.com...
[Quoted Text]
> 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" <AlexStPierre[ at ]discussions.microsoft.com> wrote in
>> message
>> news:7E730687-8871-4F22-AC09-E6C11A02B1E6[ at ]microsoft.com...
>> > 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
>>

Home | Search | Terms | Imprint Contact
Newsgroups Reader - provided by WiredBox.Net