Hide / Include sections

P

Peter Newman

i have a SQL2000 table containing all of our clients services and current
prices. I would like to create a mail merge using this information, which is
easy enough to to. What i would like to know is, is there a way to hide or
remoce sections of the word document dependant on if a field value in the
table is true.

ie, if a client does not use the archiving service they will have a 0.00
value against that service, there for when running the ,mail merge i would
like the section in the word document to not be included in this clients
letter.

if its possibel can anybody explain how i should mark the different section
on the document and hoiw to hid / show them ?
 
M

m rafala

If I follow you correctly, you would somehow need to first identify the
sections of the document or the text that represents the section. One way
might be to apply styles to the various sections. Then if your database
tells you that you don't need section X (which is styled with StyleX), you
can say:

For Each p In ActiveDocument.Paragraphs
If p.Style = "StyleX" Then
p.Range.Delete
'p.Range.Font.Hidden = True
End If
Next p
 

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