Run-Time error when calling Macro from form field

M

Michael Islip

Hi

First, excuse me if this a really obvious problem, I'm not
too hot at VBA...

I'm using Word 2002 on Windows 2000 and I'm trying to run
a macro when you click on a form element in a template.

The macro is fairly simple, it just displays the 'Insert
Picture' prompt to the user:

--
Sub ImageInsert()
Dialogs(wdDialogInsertPicture).Show
End Sub
--

It runs fine when you run it from within the document, but
I have it set to 'Run on Entry' for a text form field.
When you create a new document from this template and
click on the field I get the following error:

Run-time error '4605'
This command is not available

Any ideas what the problem might be? Thanks in advance.

Michael
 
W

Word Heretic

G'day "Michael Islip" <[email protected]>,

you can't insert a pic into a protected-for-forms section. Your macro
needs to unprotect, do the insert pic, re-protect with no reset.

Hi

First, excuse me if this a really obvious problem, I'm not
too hot at VBA...

I'm using Word 2002 on Windows 2000 and I'm trying to run
a macro when you click on a form element in a template.

The macro is fairly simple, it just displays the 'Insert
Picture' prompt to the user:

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 
W

Word Heretic

G'day <[email protected]>,

My gawd - 2/2 - a new world record for me :)

Thankyou Word Heretic. You are a fair dinkum word genius.

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
wordheretic.com

If my answers r 2 terse, ask again or hassle an MVP,
at least they get recognition for it then.
Lengthy replies offlist require payment.
 

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