C
Colin Higbie
If I want to do advanced text processing during a merge, like extracting a
first initial from the First_Name field or looking for a word in a larger
merge field in order to determine what text appears in a final merge document,
how can I do this?
Possible approaches:
Is there a way to include a Field code that automatically runs some VBA code I
wrote, so that it is executed and evaluates each record as it is merged,
looking at the first character or searching for a word within the text (like
Instr in VBA)?
Is there a way to embed those more advanced text commands into the Merge main
document (the form)?
I'm coming at this from WordPerfect where such things were trivial - you could
embed any command into the Form document and it would be executed during the
merge. The equivalent in Word would be being able to enter VBA commands as
Field codes so they are carried out during the merge. As far as I can tell,
this is impossible. The next best thing, I think, would be to be able to
launch VBA code and pass it parameters during the merge. I cannot figure out
how to do this.
Maybe I'm looking at the problem all wrong, because I am still thinking like a
WordPerfect user. Is there a whole other approach I need to take? Maybe I need
to think of the VBA running the merge, instead of the merge calling my VBA
code? If so, how would I do that and how would I specify where to do the
string processing I need?
Thanks,
Colin
first initial from the First_Name field or looking for a word in a larger
merge field in order to determine what text appears in a final merge document,
how can I do this?
Possible approaches:
Is there a way to include a Field code that automatically runs some VBA code I
wrote, so that it is executed and evaluates each record as it is merged,
looking at the first character or searching for a word within the text (like
Instr in VBA)?
Is there a way to embed those more advanced text commands into the Merge main
document (the form)?
I'm coming at this from WordPerfect where such things were trivial - you could
embed any command into the Form document and it would be executed during the
merge. The equivalent in Word would be being able to enter VBA commands as
Field codes so they are carried out during the merge. As far as I can tell,
this is impossible. The next best thing, I think, would be to be able to
launch VBA code and pass it parameters during the merge. I cannot figure out
how to do this.
Maybe I'm looking at the problem all wrong, because I am still thinking like a
WordPerfect user. Is there a whole other approach I need to take? Maybe I need
to think of the VBA running the merge, instead of the merge calling my VBA
code? If so, how would I do that and how would I specify where to do the
string processing I need?
Thanks,
Colin