I realize you already got an answer but I just wanted to add a couple more ideas.
If all of the macros are in modules (as opposed to in the ThisDocument object), then you can:
[tab]- Go to
Tools > Macro > Macros.
[tab]- Select
Organizer.
[tab]- Select all of the items in the left window.
[tab]- Select
Delete.
But, as I said, this won't get rid of code in the document itself, such as a Document_Open event.
OR, and this might be especially good if you are sending the emails with a macro anyway, you can use the following (which I adapted from something I use in Excel - I think I got it from Chip Pearson's site):
Code:
Sub DeleteAllVBACode()
Dim VBProj As VBIDE.VBProject
Dim VBComp As VBIDE.VBComponent
Dim CodeMod As VBIDE.CodeModule
Dim TargetDocName As String
TargetDocName = '[The document from which you want to strip code]
Set VBProj = Documents(TargetDocName).VBProject
For Each VBComp In VBProj.VBComponents
If VBComp.Type = vbext_ct_Document Then
Set CodeMod = VBComp.CodeModule
With CodeMod
.DeleteLines 1, .CountOfLines
End With
Else
VBProj.VBComponents.Remove VBComp
End If
Next VBComp
End Sub
[!]2 NOTES[/!]: Before you can use the above code, you may need to do the following:
[tab]- In Word, go to
Tools > Macro > Security. Go to the
Trusted Publishers tab. Check the box beside
Trust access to Visual Basic Project.
[tab]- In the VB Editor, go to
Tools > References. Select
Microsoft Visual Basic For Applications Extensibility 5.3.
[tt]_____
[blue]-John[/blue][/tt]
[tab][red]The plural of anecdote is not data[/red]
Help us help you. Please read
FAQ 181-2886 before posting.