ERROR 5941

T

Thejan Mendis

Hi,

I have created a macro which will insert some text to the bookmaks through
my User form that I created in a templete (.dot).

My problem is every time I run the templete, it will create new document and
If I might need to use anather word document and come back to my main user
form it gave me ERROR 5941.

HOW DO I TELL MY MACRO THAT IT SHOULD ONLY REFER THE DOCUMENT THAT CONTAIN
THE BOOKMARKS



THEJAN
 
D

Doug Robbins - Word MVP

Hi Thejan,

In the declarations section of the userform code, Dim a variable as a
document and then in the Initialize event for the UserForm, set that
variable to the ActiveDocument. Then refer to the bookmarks in the variable
in the balance of the code.

Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 

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