在Word 2010中,使用VBA制作第一个适合页面的文档

在Word 2010中,使用VBA制作第一个适合页面的文档,vba,ms-word,Vba,Ms Word,当Word 2010启动时,我会自动执行VBA代码 ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitFullPage 使文档适合页面 非常感谢您的提示您可以将命令放入AutoExec宏中 Sub AutoExec() ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage End Sub 您可以将如下宏添加到全局模板(例如Normal.dotm)的“ThisDocu

当Word 2010启动时,我会自动执行VBA代码

ActiveWindow.ActivePane.View.Zoom.PageFit=wdPageFitFullPage

使文档适合页面

非常感谢您的提示

您可以将命令放入AutoExec宏中

Sub AutoExec()
    ActiveWindow.ActivePane.View.Zoom.PageFit = wdPageFitFullPage
End Sub

您可以将如下宏添加到全局模板(例如Normal.dotm)的“ThisDocument”代码模块中:

Private Sub Document_Open()
With ActiveWindow
  'Reduce flickering while changing settings
  .Visible = False
  'Switch to a single view pane
  .View.SplitSpecial = wdPaneNone
  .View.Type = wdPrintView
  .ActivePane.View.Zoom.PageFit = wdPageFitFullPage
  'Restore the window now that we're finished
  .Visible = True
End With
End Sub