Form Fields populated from VBA

S

sharonm

I have a form in Word with Form Fields which I populate from an Excel VBA.
Not every Form Field is populated depending if there is data for it in my
Excel Worksheet. But I need to allow for the possibility that there might be
data which is why I keep the Form Field in the Word Form letter.

My question is if there is not data to populate the field in Word, how do I
delete that whole line. (Such as an Address2 line) from Excel VBA. I am
trying not to have blank lines without data.

THANKS!!
 
J

Jean-Guy Marcil

sharonm was telling us:
sharonm nous racontait que :
I have a form in Word with Form Fields which I populate from an Excel
VBA. Not every Form Field is populated depending if there is data for
it in my Excel Worksheet. But I need to allow for the possibility
that there might be data which is why I keep the Form Field in the
Word Form letter.

My question is if there is not data to populate the field in Word,
how do I delete that whole line. (Such as an Address2 line) from
Excel VBA. I am trying not to have blank lines without data.

Show us the code you use to populate the fields, then we can show you how to
modify your code so that if there is no data for a given field, the
corresponding paragraph will be deleted. Make sure that each field sits in a
single paragraph (without other fields in the same paragraph).

--
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
[email protected]
Word MVP site: http://www.word.mvps.org
 
Top