Sub Macro1()
'
' Macro1 Macro
' 宏在 2002-12-26 由 dcs 录制
'
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes(2).Close
End If
If ActiveWindow.ActivePane.View.Type = wdNormalView Or ActiveWindow. _
ActivePane.View.Type = wdOutlineView Then
ActiveWindow.ActivePane.View.Type = wdPrintView
End If
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
Selection.TypeText Text:="cfghdgftedgtre"
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
End Sub
以下代码:请打开demo 下面的actiex/oleauto/srvcomp/word
然后放一个buttom写以下代码:
var
dcs:OleVariant;
begin
with WordDocument do
begin
If ActiveWindow.View.SplitSpecial <> wdPaneNone Then
ActiveWindow.Panes.Item(2).close;
If (ActiveWindow.ActivePane.View.Type_ = wdNormalView) Or
(ActiveWindow.ActivePane.View.Type_ = wdOutlineView) Then
ActiveWindow.ActivePane.View.Type_ := wdPrintView;
ActiveWindow.ActivePane.View.SeekView := wdSeekCurrentPageHeader;
activeWindow.Selection.TypeText('cfghdgftedgtre');
ActiveWindow.ActivePane.View.SeekView := wdSeekMainDocument;
end;
多么好,但需要在开始 uses activex或oledb