J
Jim
I have a large number of documents that have a digitally signed macro
in them. I am attempting to mass-delete this macro from the
documents. I created a VB Script which searches the given directory,
instantiates a Word Object and opens each file one at a time.
How do I delete a macro if I have a Word.Document Object and I know the
name of the macro?
My current VBCode is attached.
Thanks in advance for any help.
-Jim
-------------------Begin Included VB Script-----------------
'Set Type of Files To Act Upon
DocumentType="Microsoft Word Document"
'Generate Objects for Filesystem, Folder, and Files within the current
folder
Set FileSysObj = CreateObject("Scripting.FileSystemObject")
Set FileSysFolder =
FileSysObj.GetFolder(FileSysObj.GetAbsolutePathName("."))
Set FileSysFiles = FileSysFolder.Files
Set Word = CreateObject("Word.Application")
Word.Visible = True
'Loop through each File In the Folder
For Each ObjFile in FileSysFiles
If (objFile.Type = DocumentType) Then
Doc_Name = FileSysFolder & "\" & objFile.Name
Word.Documents.Open(Doc_Name)
'INSERT CODE TO DELETE MACRO AutoOpen
Word.Documents(Doc_Name).Save()
Word.Documents(Doc_Name).Close()
End If
Next
Word.Quit
--------------------End Included VB Script
------------------------------------
in them. I am attempting to mass-delete this macro from the
documents. I created a VB Script which searches the given directory,
instantiates a Word Object and opens each file one at a time.
How do I delete a macro if I have a Word.Document Object and I know the
name of the macro?
My current VBCode is attached.
Thanks in advance for any help.
-Jim
-------------------Begin Included VB Script-----------------
'Set Type of Files To Act Upon
DocumentType="Microsoft Word Document"
'Generate Objects for Filesystem, Folder, and Files within the current
folder
Set FileSysObj = CreateObject("Scripting.FileSystemObject")
Set FileSysFolder =
FileSysObj.GetFolder(FileSysObj.GetAbsolutePathName("."))
Set FileSysFiles = FileSysFolder.Files
Set Word = CreateObject("Word.Application")
Word.Visible = True
'Loop through each File In the Folder
For Each ObjFile in FileSysFiles
If (objFile.Type = DocumentType) Then
Doc_Name = FileSysFolder & "\" & objFile.Name
Word.Documents.Open(Doc_Name)
'INSERT CODE TO DELETE MACRO AutoOpen
Word.Documents(Doc_Name).Save()
Word.Documents(Doc_Name).Close()
End If
Next
Word.Quit
--------------------End Included VB Script
------------------------------------