adding autotext to a template

A

Addy

Sorry just realised that its putting in the name of the address but not the
address itself from the autotext - any ideas. I've sorted the other address
field and thats worked - sorry to bug you again this is honestly the very
last bit !!
 
J

Jean-Guy Marcil

Addy was telling us:
Addy nous racontait que :
Sorry just realised that its putting in the name of the address but
not the address itself from the autotext - any ideas. I've sorted
the other address field and thats worked - sorry to bug you again
this is honestly the very last bit !!

Sorry, but I do not understand what you are trying to do.

What AutoText?
Where is the address "name" coming from?


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

Addy

The autotext I am trying to put in is a whole address such as :-

Barnsley County Court
12 Regent Street
BARNSLEY
S70 2EW

but it is just putting in Barnsley County Court and not the rest of the
address. Obviously if I go into the letter afterwards and press f3 it will
complete the rest of the autotext but wondered if there was something within
the code that would complete it. I have found a code "InsertAutoText" which
I am fiddling around with. I thought of replacing :-

..Bookmarks("address").Range.text = straddress
with
..Bookmarks("address").Range.InsertAutoText = straddress

but it doesn't work

cheers
 
A

Addy

I've got it so that it puts the whole address in the dropdown box but I
really only want the company in the dropdown box and the full address to be
added to the letter. I added it by putting:-

For Each oAutotext In oTemplate.AutoTextEntries
.CBOAddress.AddItem oAutotext.Value
rather than
For Each oAutotext In oTemplate.AutoTextEntries
.CBOAddress.AddItem oAutotext.Name

I've tried changing:-

strAddress = .CBOAddress.Text
to
strAddress = .CBOAddress.Value

but it still doesn't put the whole address in.

cheers
 
J

Jean-Guy Marcil

Addy was telling us:
Addy nous racontait que :
I've got it so that it puts the whole address in the dropdown box but
I really only want the company in the dropdown box and the full
address to be added to the letter. I added it by putting:-

For Each oAutotext In oTemplate.AutoTextEntries
.CBOAddress.AddItem oAutotext.Value
rather than
For Each oAutotext In oTemplate.AutoTextEntries
.CBOAddress.AddItem oAutotext.Name

I've tried changing:-

strAddress = .CBOAddress.Text
to
strAddress = .CBOAddress.Value

but it still doesn't put the whole address in.

So, if I get this right,

In the userform, the user selects a company.
In the template you have stored each company address as an autotext
So, when the user is done with the userform, you need to correlate the
company name that was selected on the userform with the appropriate address
and enter it in the document at a bookmark.

Is that right?

--
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