Error with execute method of Find object

L

Lolan_p

I have used code like this several times to change the formatting of text on
protected forms, but now I seem to be getting errormessages like "command not
available" or "method or property is not available because the object refers
to a protected area of the document". The bookmark or formfield the
selection refers to is the one of the sections of the document that is not
protect so the user can enter in their information. How can I get around
this problem? Another point it is works for several other bookmarks
(formfields) in the document but not others? Why? I have had similar
problems with inserting tables into forms at bookmarks as well sometimes it
works other times it doesn't and I can't seem to find out why?
I have been writing the code using Office 2000 because a lot of the user are
still using that product.

ActiveDocument.Bookmarks("txtContributor").Select
With Selection.Find
.ClearFormatting
.Text = strTmp
.Replacement.ClearFormatting
.Replacement.Font.Bold = True
.Replacement.Text = strTmp
.Execute Replace:=wdReplaceOne
End With

Thanks for your time and help.
 
A

aalaan

....> I have been writing the code using Office 2000 because a lot of the
user are
still using that product.
Yes, and IMHO that version is fully stable and in that respect it beats Word
2003 and definitely Word 2007!
 

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