|
我这里在word文件中有页眉信息,页眉中是个表格,需要向指定的单元格中插入值,录制的宏代码不懂,请求帮忙
分析分析:
Selection.TypeText Text:="1" ————行中
Selection.TypeText与 Text 中间是个空格,是什么关系?
附宏代码:
Sub Macro41111111()
'
' Macro41111111 Macro
' 宏在 2010-12-31 由 未定义 录制
'
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.MoveRight Unit:=wdCharacter, Count:=5
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="2"
Selection.MoveDown Unit:=wdLine, Count:=1
Selection.TypeText Text:="3"
Selection.MoveRight Unit:=wdCharacter, Count:=9
Selection.MoveLeft Unit:=wdCharacter, Count:=2
Selection.TypeText Text:="4"
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="5"
Selection.MoveUp Unit:=wdLine, Count:=1
Selection.TypeText Text:="6"
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
ActiveDocument.Save
End Sub
|
|