Auto_Open

S

Scott M.

Does Word XP VBA have a way to have a specific procedure in a module
automatically run as the document is opened like Auto_Open used to do?
 
J

Jonathan West

Hi Scott,

Yes, it's called AutoOpen. Place a macro of that name in a template, and
every document based on that template will run that macro when it is opened.
 
S

Scott M.

Thanks Jonathan. I just figured that out. It used to be (in the good old
days) that the procedure had to be called Auto_Open and it had to be in a
module. Now it has to be AutoOpen and placed in the document.
 
D

Doug Robbins - Word MVP - DELETE UPPERCASE CHARACT

Hi Scott,

I think that you are mixing up Excel and Word. AFAIK it has always been
AutoOpen in Word and Auto_Open in Excel. Don't ask me why.

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

Jay Freedman

Hi, Scott,

I'll second what Doug said -- in Word, it has been AutoOpen since VBA
was introduced in Word 97. The Auto_Open syntax belongs to Excel.
(Somebody at MS failed when it came to making the various
implementations of VBA as similar as possible.)

Also,is not correct. Reread what Jonathan said -- the macro goes in a
module in the *template* on which you base documents. If you stick it
into the document itself, that will trigger the macro virus warning.

"Doug Robbins - Word MVP - DELETE UPPERCASE CHARACTERS FROM EMAIL
 

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