Delete smart tags automatically

M

Macro''''er

Hello, Can someone please provide me a macro I can use for..

If there is a smart tags in the document, to automatically removed them
prior to closing or exiting.

I'd appreciate any help! Thank you!
 
J

Jay Freedman

Hello, Can someone please provide me a macro I can use for..

If there is a smart tags in the document, to automatically removed them
prior to closing or exiting.

I'd appreciate any help! Thank you!

The following is copied directly from the Help topic for the
RemoveSmartTags method:

~~~~~

This example removes all smart tag information from the active
document.

Sub SmartTagRemove()
ActiveDocument.RemoveSmartTags
End Sub

~~~~~

But for what you want, it's probably sufficient to go to Tools >
Options > Save and uncheck the box for "Embed smart tags". They won't
be saved in the file, although if you have smart tags enabled in your
Word program they'll be rebuilt when you reopen the document.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.
 
M

Macro''''er

Thanks for your quick response. How can I incorporate the codes you provided
with the AutoClose macro? We worked with several documents and often times
the editor forgets to remove the smart tags prior to closing so I would like
to run a macro where when they close the document; the macro will
automatically remove smart tags.

Thanks again!

Sub SmartTagRemove()
ActiveDocument.RemoveSmartTags
End Sub
 
M

Macro''''er

Thanks Graham.

So new at this macro stuff so pardon my "stupid" question. I added the code
below in my template module. Would there be any issue adding this in the
module and not in the objects? I'm not sure what the "Private Sub
Document_Close" as oppose to "Sub Document_Close".

Private Sub Document_Close()

ActiveDocument.RemoveSmartTags

End Sub
 

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