Suppressing AutoClose Macro when Creating TOC Spanning Multiple Do

B

Barb R.

I have created a TOC from multiple documents using the RD field code as
described in the following:

"Creating a Table of Contents Spanning Multiple Documents"
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=148

I am contemplating adding an AutoClose macro to the documents referenced by
the RD field code. Is there a way to suppress the running of the AutoClose
macro when I access the documents using the method described above?

Thanks in advance,
Barb Reinhardt
 
J

Jay Freedman

I have created a TOC from multiple documents using the RD field code as
described in the following:

"Creating a Table of Contents Spanning Multiple Documents"
http://pubs.logicalexpressions.com/Pub0009/LPMArticle.asp?ID=148

I am contemplating adding an AutoClose macro to the documents referenced by
the RD field code. Is there a way to suppress the running of the AutoClose
macro when I access the documents using the method described above?

Thanks in advance,
Barb Reinhardt

I'm not 100% sure this will work, but try putting the line

WordBasic.DisableAutoMacros 1

just before the line

Set oDoc = Documents.Open(FileName:=strCode)

I know it will suppress AutoOpen and AutoExec, just not sure about
AutoClose.

You ought to be aware of
http://www.word.mvps.org/FAQs/MacrosVBA/WordBasicCommands.htm -- it's
very helpful sometimes.
 
B

Barb R.

That appears to work, THANKS! I'll look at the link you supplied. I'm sure
that will help me.

Barb Reinhardt
 

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