å¦ææç解ä¸éçè¯ï¼ä½ æ¯å¨ç¨vb6è°ç¨office çCOM interfaceæ¥åautomationçãè¦æ³æ¹åç页çä¸è¥¿ä¼¼ä¹éè¦å
æ¹åè§å¾ï¼ç¶åå å
¥ä¸ä¸ªè¡¨æ ¼ï¼å¦æä½ è¯´çè¡¨æ ¼æ¯tableçè¯ï¼ï¼ç¶åä¿®æ¹tableçå
容ï¼æååè·³åå°main documentè§å¾ã
è¿æ¯æç¨vbaå½çå®ï¼åºè¯¥å¾å®¹æä¿®æ¹ævb6ç代ç ãææä¸æ²¡ævb6,ä¸è¿æ估计差ä¸å¤ã大家ä¸è¬ç¨vb6ä¹è³.netæ¥åofficeçautomationï¼ä¸ç¥éçä¸è¥¿é½æ¯ç¨vbaå½å®ç¶åç¿»è¯çã
================
ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
ActiveDocument.Tables.Add Range:=Selection.Range, NumRows:=2, NumColumns:= _
3, DefaultTableBehavior:=wdWord9TableBehavior, AutoFitBehavior:= _
wdAutoFitFixed
With Selection.Tables(1)
If .Style <> "Table Grid" Then
.Style = "Table Grid"
End If
.ApplyStyleHeadingRows = True
.ApplyStyleLastRow = False
.ApplyStyleFirstColumn = True
.ApplyStyleLastColumn = False
.ApplyStyleRowBands = True
.ApplyStyleColumnBands = False
End With
Selection.TypeText Text:="cell1"
Selection.MoveRight Unit:=wdCell
Selection.TypeText Text:="cell2"
ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
--------
追é®ä¸è¡ï¼åå
¥æ£æä¸çè¡¨æ ¼äº
追çä½ æActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeaderä¹åç代ç 注è§æï¼ççè½ä¸è½è·³å°headerçç¼è¾ç¶æå
ãå¦æè½è·³è¿å»ï¼ä¼°è®¡æ¯tableçæ¾ç½®ç¹æé®é¢ãå¦æä¸è½çè¯å°±å¾åæ³è¾äºã