I was asked to come up with a way to automate a clean-up project of existing documents...to remove unwanted styles, update some paragraph styles, reset the page margins, etc.
The macro resides in a separate template from the document template used to generate new documents. (The document...
I've tried "Lock project for viewing" with a password. The problem is, the macro has to reside in a template on a server so that many people can access it. The lock project feature prevents the macro from being copied through the Organizer into the document where the macro will be run.
I'm...
Is there a way to make Word macro code available for others to use but at the same time hide the code or deny access to the code to protect it from tampering?
Thanks for your help and advice. Your solutions are interesting and clever. Now that I have something working, I'll try some of your suggestions to refine my code and make it more efficient.
Your suggestion to use the "On Error Resume Next" statement made all the difference. My macro now works...here is a sample of the code:
Sub RemoveStylesNow()
ActiveDocument.Styles("1.").Delete
On Error Resume Next
ActiveDocument.Styles("1.1").Delete
On Error Resume...
I'm new at using VBA (using MSWord 2003). I'm trying to create a macro that deletes user-defined styles in ActiveDocument that are no longer needed or used. I've tried various solutions. For example:
ActiveDocument.Styles("1.1")Delete
ActiveDocument.Styles("1.1.1")Delete
and so forth, works...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.