Re: VBA to remove modules in .DOT
- From: "Needmo..." <a@xxxxx>
- Date: Wed, 13 Apr 2005 04:34:57 GMT
Had a bit of trouble with my news reader... but Success on the Word
front!
To Perry (and anyone else interested):
I did the following and I like what it does for me (on first test
anyway).
This doesn't remove anything from the .DOT -- it just breaks any
association between the .DOC and the "master" .DOT.
This works for me because now the VBA code maros are not in any way tied
to
the .DOC.
Happy April to all,
Warren
Needmo Smarts <not_here@xxxxxxxxxxxx> wrote in
news:Xns9634D8E999B62xkxnxaxuxex@xxxxxxxxxxxxxx:
> Perry,
> Thanks for hanging in there & providing help.
> You are somewhat over my head--I don't know anything about the VBA
> Extensibility lib 53. I am using Word 2000 and have no other VB
> product. I will try using the Subs you've provided when I get the
> chance this week at work (BIG assumption!) Looks like I'll need to
> declare and use an object representing the current document...
>
> Thanks,
> Warren
>
> "Perry" <DrumProgrammer@xxxxxxxxxxx> wrote in
> news:#OWq93bPFHA.1564@xxxxxxxxxxxxxxxxxxxx:
>
>> Add a reference in VBE pointing to: Microsoft VBA Extensibility lib
>> 53 Two examples removing either a module "MYModule" or a macro
>> "MyMacro" from a document represented by object variable:
>> "TargetDocument"
>>
>> Sub DeleteProcedure()
>> Dim vbc As VBComponent
>> Set vbc = TargetDocument.VBProject.VBComponents("MYModule")
>> With vbc.CodeModule
>> .DeleteLines .ProcStartLine("MyMacro", vbext_pk_Proc), _
>> .ProcCountLines("MyMacro", vbext_pk_Proc)
>> End With
>> End Sub
>>
>> Sub DeleteModule()
>> Dim vbc As VBComponent
>> Set vbc = TargetDocument.VBProject.VBComponents("MYModule")
>> ThisDocument.VBProject.VBComponents.Remove vbc
>> End Sub
>>
>>
>> Krgrds,
>> Perry
>>
>
.
- Follow-Ups:
- Re: VBA to remove modules in .DOT
- From: Needmo Smarts
- Re: VBA to remove modules in .DOT
- References:
- Re: VBA to remove modules in .DOT
- From: Perry
- Re: VBA to remove modules in .DOT
- From: Needmo Smarts
- Re: VBA to remove modules in .DOT
- From: Perry
- Re: VBA to remove modules in .DOT
- From: Needmo Smarts
- Re: VBA to remove modules in .DOT
- Prev by Date: Success!
- Next by Date: Re: VBA to remove modules in .DOT
- Previous by thread: Re: VBA to remove modules in .DOT
- Next by thread: Re: VBA to remove modules in .DOT
- Index(es):
Relevant Pages
|