includetext field in word to import excel work sheet

M

MandyK

I am creating a word mail merge where when a certain criteria is met, a named
sheet from an excel wookbook is imported. I have managed to get the workbook
to import but i need to select which sheet each time. Is there any code I
can enter in the if statement so that it automatically picks up a specific
sheet when it meets the intended criteria? I'm on Microsoft Office 2003.
Below is the if statement I am currently using.

{IF { MERGEFIELD LeagueNumber } = 1 "{ INCLUDETEXT "c:\\leaguetable.xls" }"
"{ AUTOTEXT Copyright }"}
 
D

Doug Robbins

Use something like

{LINK Excel.Sheet.8 "C:\\Access\\tblEvaporatorLoads.xls"
"tblEvaporatorLoads!R1C1:R87C4" }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
M

MandyK

Thanks, this worked!

Kind regards,
MandyK

Doug Robbins said:
Use something like

{LINK Excel.Sheet.8 "C:\\Access\\tblEvaporatorLoads.xls"
"tblEvaporatorLoads!R1C1:R87C4" }

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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