How to disable SaveAs in Ms word in vb.net

人走茶凉 提交于 2019-12-11 04:43:00

问题


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


回答1:


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


来源:https://stackoverflow.com/questions/12643164/how-to-disable-saveas-in-ms-word-in-vb-net

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!