一、基本

(1) 按 Enter 鍵:Selection.TypeParagraph

(2) 設定固定行距:
      Selection.ParagraphFormat.LineSpacingRule = wdLineSpaceExactly
      Selection.ParagraphFormat.LineSpacing = 18  (註:依個人需求修改)

(3) 分割表格:Selection.SplitTable

(4) 游標向上移5列:
     Selection.MoveUp Unit:=wdLine, Count:=5, Extend:=wdExtend

     游標向下移5列:
     Selection.MoveDown Unit:=wdLine, Count:=5, Extend:=wdExtend

(5) 設定字體大小:Selection.Font.Size = FontSize

(6) 在游標處加入文字:Selection.TypeText Text:=....

(7)


二、表格相關

(1) 選擇文件中第一個表格:ActiveDocument.Tables(1).Select

(2) 平均分配欄寬:Selection.Cells.DistributeWidth

(3) 移到表格左上方第一格:Selection.HomeKey Unit:=wdStory

(4) 複製文件中第一個表格的第1列,並貼在某處:
     ActiveDocument.Tables(1).Rows(1).Range.Copy
     Selection.Collapse Direction:=wdCollapseStart
     Selection.Paste

(5) 刪除文件中第一個表格第一列第1格(非刪除內容):
     ActiveDocument.Tables(1).Cell(1, 1).Delete 

(6) 取得文件中第一個表格之行數:
      ActiveDocument.Tables(1).Columns.Count

      取得文件中第一個表格之列數:
      ActiveDocument.Tables(1).Row.Count

(7) 在文件中第一個表格之第2列第1欄尾端插入文字:
      ActiveDocument.Tables(i).Cell(2, 1).Range..InsertAfter "插入文字"

(8) 將游標移至某個表格中的左上方格:
      ActiveDocument.Tables(i).Cell(1, 1).Select

arrow
arrow
    全站熱搜

    ydmqqq 發表在 痞客邦 留言(1) 人氣()