Word 中使用“打开并修复”功能打开文档

上一篇 / 下一篇  2011-03-30 22:36:56 / 个人分类:技术我解

方法 1:打开特定的文档

  • 启动 Word。
  • 在“文件”菜单上,单击“打开”。
  • 在“打开”对话框中,单击以选择要打开的文件。
  • 单击“打开”按钮上的向下箭头,然后单击“打开并修复”。

      方法 2:打开所有文档

      1. 启动 Word,然后打开一个新建的空白文档。
      2. 在“工具”菜单上,指向“宏”,然后单击“宏”。
      3. 单击“宏的位置”框中的下箭头,然后单击“Word 命令”。
      4. 在“宏名”列表中,单击“FileOpen”。
      5. 单击“宏的位置”框中的下箭头,然后单击“Normal.dot(共用模板)”。
      6. 单击“创建”。
      7. 内置的 FileOpen 宏如下面的示例所示:
      Sub FileOpen()
      '
      ' FileOpen Macro
      ' Opens an existing document or template
      '
          Dialogs(wdDialogFileOpen).Show
      
      End Sub
      8. 将内置的 FileOpen 宏替换为下面的宏示例:
      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 template
      '
      Dim sFileName As String
      
      ' Display the File Open dialog and capture the filename selected and pass it to a
      ' variable
      With Application.Dialogs(wdDialogFileOpen)
          .Display
          sFileName = .Name
      End 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 skipped
      If sFileName <> "" Then
          ' Use the filename as a variable to be opened using Open and Repair feature
          Documents.Open FileName:=sFileName, OpenAndRepair:=True
      End If
      
      End Sub
      1. 在“文件”菜单上,单击“关闭并返回到 Microsoft Word”。
      2. 在“文件”菜单上,按 Shift,然后单击“全部保存”。
      注意
      • 仅当您使用以下方法之一来打开文档时,新的 FileOpen 宏才会运行:
        • 单击“文件”菜单中的“打开”。
        • 单击“常用”工具栏中的“打开”。
      • 如果您使用以下方法之一来打开文档,新的 FileOpen 宏不会运行:
        • Windows 资源管理器中打开文档。
        • 从最近使用过的 (MRU) 文件列表中打开文档。
      转自:http://support.microsoft.com/kb/893672/zh-cn

    1. TAG:

       

      评分:0

      我来说两句

      Open Toolbar