發表文章

目前顯示的是有「Word_VBA」標籤的文章

WORD_VBA_選定首行做處理

             開始學習Word  VBA,不過用在word上比較少,因此打算可能會用到的語句開始,雖然同樣是VBA,但excel VBA跟word VBA 還是有些差異處,語法方式看起來是一樣。 Sub 對於文章中每段首行做標示() application.screenupdating = false     Dim i As Long     Selection.HomeKey unit:=wdStory     Do         Selection.EndKey unit:=wdLine, Extend:=wdExtend         Selection.Font.Color = wdColorRed '紅色         Selection.Font.Bold = True '粗體         Selection.Font.Underline = wdUnderlineWavyHeavy '波浪線         Selection.MoveDown unit:=wdParagraph, Count:=1'往下移動         i = i + 1     Loop Until i = ActiveDocument.Paragraphs.Count End Sub