Trích:
Nguyên văn bởi DrBlack
như bạn nói, mình có thể dùng phím tắt Shift F3 mà :D
vấn đề là thủ công quá :-s
|
Mấy hôm trước mình bận, hôm nay mới có thời gian để thử code cái macro theo yêu cầu của bạn. Hy vọng sẽ dùng đc, mình mới chạy thử cho 1 file nhỏ.
Trích:
Sub VietHoaChuCaiDau()
Application.ScreenUpdating = False
ActiveWindow.View.Type = wdOutlineView
ActiveWindow.View.ShowHeading 9
Selection.HomeKey Unit:=wdStory
Selection.MoveDown Unit:=wdParagraph, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdTitleWord
n = Selection.End
Selection.MoveRight Unit:=wdCharacter, Count:=2
Do Until Selection.End = n + 1
Selection.MoveDown Unit:=wdParagraph, Count:=1
Selection.MoveLeft Unit:=wdCharacter, Count:=1
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdTitleWord
n = Selection.End
Selection.MoveRight Unit:=wdCharacter, Count:=2
Loop
Selection.EndKey Unit:=wdStory
Selection.MoveUp Unit:=wdParagraph, Count:=1, Extend:=wdExtend
Selection.Range.Case = wdTitleWord
ActiveWindow.View.Type = wdPrintView
Selection.HomeKey Unit:=wdStory
Application.ScreenUpdating = True
ActiveDocument.UndoClear
End Sub
|