Disable a macro after specific procedure

R

Russ

Jeffrey,

I did something similar on some templates recently. When a
new document is created in sub Autonew()

ActiveDocument.CustomDocumentProperties.Add
Name:="newdoc", LinkToContent:=False, _
Value:="Yes", Type:=msoPropertyTypeString

as the last line before End Sub.

In the Autoopen() sub, make your first line if
ActiveDocument.CustomDocumentProperties("newdoc") = "Yes"
then goto theend

This will ensure that if a user opens the document, the
custom property is 'Yes' and will automatically bypass all
code.

Hope this makes sense.
 

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