I believe I'm almost there. Instead of replacing the bookmark names with the
entered text, it is appending the text instead. This is a one-line sample for
one of the bookmarks - can anyone LMK what I'm doing wrong?
.Bookmarks("NameAddress").Range.InsertBefore NameAddress
TIA
Amanda
The code you have *always* inserts text in addition to whatever is
already in the bookmark. It works out ok if the bookmark contains one
space character and nothing else, because you usually want a space
after the inserted text. But if there's already text there and you
want to replace it, you have to use a different command,
.Bookmarks("NameAddress").Range.Text = NameAddress
Besides replacing the existing text, that command will also destroy
the bookmark. If you expect to need the bookmark afterward for
anything (such as replacing its contents again), you have to re-insert
the bookmark. See
http://www.word.mvps.org/FAQs/MacrosVBA/InsertingTextAtBookmark.htm
for sample code.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>I believe I'm almost there. Instead of replacing the bookmark names with the
>entered text, it is appending the text instead. This is a one-line sample for
[quoted text clipped - 80 lines]
>> > >> > > > TIA
>> > >> > > > Amanda
Birmangirl - 15 Aug 2006 08:53 GMT
Thanks for your response Jay - this has solved my problem :)
The only query I still have is the one of using one field for the full
name/address. If I use separate fields, I'll have the issue of having to
suppress blank lines.
If this is the only way around the problem, then so be it - but if there's a
better way, I'd love to know...
TIA
Amanda
> The code you have *always* inserts text in addition to whatever is
> already in the bookmark. It works out ok if the bookmark contains one
[quoted text clipped - 102 lines]
> >> > >> > > > TIA
> >> > >> > > > Amanda
Jay Freedman - 15 Aug 2006 14:27 GMT
Sorry, I didn't read the quoted message preceding the one I responded
to, and missed the question about Enter in a text field. Again, the
answer is simple: In the userform editor, select the text box. If the
Properties pane isn't visible, press F4 to display it. Find the
EnterKeyBehavior and MultiLine properties and set both of them to
True.
--
Regards,
Jay Freedman
Microsoft Word MVP FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
>Thanks for your response Jay - this has solved my problem :)
>The only query I still have is the one of using one field for the full
[quoted text clipped - 112 lines]
>> >> > >> > > > TIA
>> >> > >> > > > Amanda
Birmangirl - 15 Aug 2006 15:10 GMT
Thank you Jay for the last piece "of the jigsaw" - everything is working
perfectly now and at last I can put this template to bed :)
Cheers
Amanda
> Sorry, I didn't read the quoted message preceding the one I responded
> to, and missed the question about Enter in a text field. Again, the
[quoted text clipped - 126 lines]
> >> >> > >> > > > TIA
> >> >> > >> > > > Amanda