VBA equivalent to SHIFT + Right click OPEN

N

Neil Humphries

I need to search the content of a number of files with AutoOpen or AutoNew
macros without having the macros run. I can do this from the keyboard by
holding down the SHIFT key and selecting OPEN from the right click (context?)
menu. How do I do the equivalent using VBA?
 
J

Jonathan West

Neil Humphries said:
I need to search the content of a number of files with AutoOpen or AutoNew
macros without having the macros run. I can do this from the keyboard by
holding down the SHIFT key and selecting OPEN from the right click
(context?)
menu. How do I do the equivalent using VBA?

Wordbasic.DisableAutomacros 1
Documents.Open("C:\myfile.doc")
Wordbasic.DisableAutomacros 0
 
N

Neil Humphries

Thanks, Jonathan. That works just fine.

Now if I could get a workable answer to my post of January 26th "Making a
document open a userform in the originating template", I would be in great
shape.
 
D

Doug Robbins - Word MVP

See response to that thread.

--
Hope this helps,

Doug Robbins - Word MVP

Please reply only to the newsgroups unless you wish to obtain my services on
a paid professional basis.
 

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