disable macros in word

A

Associates

Hi,

I would like to be able to write codes to disable macros in VBA for office
word 03 document.

I wonder if anyone might be able to guide me on how to do this?

Thank you in advance
 
G

Graham Mayor

If you save macros in a document then a user can re-enable them. The only
solution is to remove them. You can do this with the macro organizer, or you
could save as RTF which does not support macros eg

Dim sFname As String
With ActiveDocument
If .Path = "" Then
.Save
End If
sFname = .FullName
sFname = Left(sFname, Len(sFname) - 3)
MsgBox sFname
.SaveAs FileName:=sFname & "RTF", _
FileFormat:=wdFormatRTF
.Close
End With
Documents.Open FileName:=sFname & "RTF"
ActiveDocument.SaveAs sFname & "doc", _
FileFormat:=wdFormatDocument
 
G

Graham Mayor

On reflection it might be better to change

If .Path = "" Then
.Save
End If

to simply
.Save


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP


<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top