How to disable SaveAs in Ms word in vb.net

2019-08-01 07:16发布

How can i disable Save as in MS word or in any other office using vb.net?

标签: vba ms-office
1条回答
混吃等死
2楼-- · 2019-08-01 07:44

You need to use VBA Macro to disable Save As Option. Code to disable in Excel is :

 Private Sub Workbook_BeforeSave (ByVal SaveAsUI As Boolean, Cancel As Boolean)

'This macro disables the "Save As" Feature in Excel
'This means that a user will not be able to save this
'workbook(file) under a different name or in a different location
'
'This MUST be placed in "ThisWorkbook" and NOT in a Module.
'

    If SaveAsUI = True Then Cancel = True

End Sub
查看更多
登录 后发表回答