Bookmarks & IFs

G

Garth Wells

I have an Access app that uses VBA and bookmarks
to pass data to a Word 2000 doc. Inside the Word
doc I use IF statements to determine whether a text
block should be displayed. This is working, but what
I have found is that when a block is not shown, a
ParaMark is added.

Let's say I have 4 IF statements and only IFs 1 and 4
evaluate to True. I end up with:

Text shown when IF 1 is True
New Page
ParaMark
ParaMark
ParaMark
Text shown when IF 4 is True

I have reviewed the template .doc for embedded
ParaMarks, but have not found any. The only thing I
can think of is to programmatically move to each new
page and remove all leading ParaMarks. I do not,
however, know how to do this. Any suggestions are
appreciated.
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Garth Wells > écrivait :
In this message, < Garth Wells > wrote:

|| I have an Access app that uses VBA and bookmarks
|| to pass data to a Word 2000 doc. Inside the Word
|| doc I use IF statements to determine whether a text
|| block should be displayed. This is working, but what
|| I have found is that when a block is not shown, a
|| ParaMark is added.
||
|| Let's say I have 4 IF statements and only IFs 1 and 4
|| evaluate to True. I end up with:
||
|| Text shown when IF 1 is True
|| New Page
|| ParaMark
|| ParaMark
|| ParaMark
|| Text shown when IF 4 is True
||
|| I have reviewed the template .doc for embedded
|| ParaMarks, but have not found any. The only thing I
|| can think of is to programmatically move to each new
|| page and remove all leading ParaMarks. I do not,
|| however, know how to do this. Any suggestions are
|| appreciated.

Are the ¶ already there?
I mean, do you have something like:

{ IF one}¶
{ IF two}¶
{ IF three}¶
{ IF four}¶
?
If so, you can inlcude the ¶ inside the field code itself:

E.g.:
{IF {PAGE} = 1 "Then add line¶ " "No line added"}
or use a QUOTE field to add a manual line return:
{IF {PAGE} = 1 "Then add line{QUOTE 11}" "No line added"}

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 
G

Garth Wells

No, they are not present. What I have looks somehting like
this:

{ If BkMrk1 = "a" "display this text a PageBreak" "" }
{ If BkMrk2 = "b" "display this text b PageBreak" "" }
{ If BkMrk3 = "c" "display this text c PageBreak" "" }
{ If BkMrk4 = "d" "display this text d PageBreak" "" }

Assuming the 1st and 4th evaluate to True, I end up with:

display this text a
PageBreak



display this text d
PageBreak
 
J

Jean-Guy Marcil

Bonjour,

Dans son message, < Garth Wells > écrivait :
In this message, < Garth Wells > wrote:

|| No, they are not present. What I have looks somehting like
|| this:
||
|| { If BkMrk1 = "a" "display this text a PageBreak" "" }
|| { If BkMrk2 = "b" "display this text b PageBreak" "" }
|| { If BkMrk3 = "c" "display this text c PageBreak" "" }
|| { If BkMrk4 = "d" "display this text d PageBreak" "" }

I do not understand.... How did you get each IF field on its own line
without using paragraph marks or "soft returns" (SHIFT-Enter)?

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
(e-mail address removed)
Word MVP site: http://www.word.mvps.org
 

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