editautotext 'object doesn't support this property or method'

C

Chris

Found this code off a MVP web site and trying to tweak it to work with
Access and Word 2000 I get the error message "object doesn't supprt this
property or method" on the editautotext line



code in Access 2000 is applying to word template with offerlist added as
autotext



If strPrdList <> "NONE" Then
With objWord
.EditAutoText Name:="OfferList", Context:=1, INSERT:=True
.CharLeft
.INSERT strPrdList
.EditGoto "\Para"
.Bold
.BorderTop 1
End With
End If

Any ideas appreciated

Thanks

Chris
 
M

Mick Hardy

Hi Chris,

This is very old WordBasic code. You need to use the newer object
model.

NormalTemplate.AutoTextEntries.Add "Test", Selection.Range

Look up help on AutotextEntries. You have to define a range prior to
adding an autotext entry. You would then set all the properties such
as font and borders of the range. The above line of code adds the
currently selected piece of text to the Normal template. Then
whenever you type Test, you get the autotext option of inserting
whatever was selected. Hardly a good thing to do but it should lead
you towards the right path.

Mick
 

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