• Macro to delete Macro (Word2000/SR1a & SP2)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Macro to delete Macro (Word2000/SR1a & SP2)

    Author
    Topic
    #367719

    We have someone that needs a macro that will delete a macro; she runs a program that writes a temporary macro that is deleted once the process runs through; however, she sometimes crashes and then the temporary macro has to be manually deleted. She wants a toolbar button to accomplish this and for the life of me, I don’t know how to write a macro to delete another macro. Any help out there on this would be greatly appreciated.

    Viewing 0 reply threads
    Author
    Replies
    • #574164

      The information and code that you need is on Chip Pearson’s site. –Sam

      • #574171

        Sammy, that all pertained to Excel Workbooks; I need to delete a Word macro.

        • #574194

          But I don’t think that matters: you’re just using the IDE not anything in the Excel object model. Try it, I think it will work (but I’ve not tried it myself).

          • #574221

            Perhaps changing ThisWorkbook to ThisDocument is all that would be required. That and setting a reference to the VBA Extensibility library.

            If you are okay with deleting an entire module, rather than an individual macro in a module, you can use this one-liner:

            Application.OrganizerDelete Source:=NormalTemplate, _
            Name:=”Module1“, Object:=wdOrganizerObjectProjectItems

            It ruthlessly removes modules without any backup.

    Viewing 0 reply threads
    Reply To: Macro to delete Macro (Word2000/SR1a & SP2)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: