Word 2003如何使用“打开并修复”功能打开文档
来源:网络收集 点击: 时间:2024-03-29启动 Word 2003,单击“文件”,单击“打开”

在“打开”对话框浏览到出问题的文档上,选中后单击右下角“打开”按钮的三角箭头,出来的下拉菜单选择“打开并修复”命令

启动 Word 2003,接着打开一个新建的空白文档

单击“工具”菜单,出来的菜单窗口指向“宏”,在下一级菜单单击“宏”命令

弹出“宏”对话框,单击打开“宏的位置”的下拉框列表,选择“Word 命令”选项

在“宏名”框中键入“FileOpen”或直接在列表中找到并单击“FileOpen”

单击“宏的位置”的三角箭头按钮,出来的下拉列表框选择“Normal.dot(共用模板)”

然后单击右侧的“创建”按钮

复制以下代码,并粘贴替换到打开的代码窗口中
Option Explicit
WARNING: ANY USE BY YOU OF THE CODE PROVIDED IN THIS EXAMPLE IS AT YOUR OWN RISK. Microsoft provides this macro code as is without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.
Sub FileOpen() FileOpen Macro Opens an existing document or templateDim sFileName As String
Display the File Open dialog and capture the filename selected and pass it to a variableWith Application.Dialogs(wdDialogFileOpen) .Display sFileName = .NameEnd With
Test to verify the filename has a value If no file is chosen or if the Open dialog is dismissed, the following code is skippedIf sFileName Then Use the filename as a variable to be opened using Open and Repair feature Documents.Open FileName:=sFileName, OpenAndRepair:=TrueEnd If
End Sub

单击“文件”菜单,显示的菜单界面单击“关闭并返回到 Microsoft Word”

按住Shift键,然后在菜单栏单击“文件”——“全部保存”

版权声明:
1、本文系转载,版权归原作者所有,旨在传递信息,不代表看本站的观点和立场。
2、本站仅提供信息发布平台,不承担相关法律责任。
3、若侵犯您的版权或隐私,请联系本站管理员删除。
4、文章链接:http://www.1haoku.cn/art_373961.html