當前位置:成語大全網 - 新華字典 - 關於Word中 的VBA 編程

關於Word中 的VBA 編程

解決妳的“順便問下".....

Sub Macro1()

Dim strText As String

strText = "建立反對撒客裏空的龍卷風"

Selection.TypeText strText

Selection.MoveStart Unit:=wdLine, Count:=-1

Selection.MoveEnd Unit:=wdCharacter, Count:=-1 * (Len(Selection.Text) - 4)

Selection.MoveStart Unit:=wdCharacter, Count:=3

Selection.Font.Bold = True

MsgBox Selection.Text

End Sub