Gửi bởi
boomxxl
cảm ơn bác nó đây... tách thành 3 file.. mò mãi chả biết cách...[IMG]images/smilies/a36.gif[/IMG]
Bạn thử dùng Macro này xem.
Mã nguồn PHP:
Sub SlpipFile()Dim i As LongApplication.ScreenUpdating = FalseChangeFileOpenDirectory ActiveDocument.PathSelection.Find.ClearFormattingWith Selection.Find .Text = "^k" .Forward = True .Wrap = wdFindContinueEnd WithActiveDocument.Range(0, 0).SelectDo Until Selection.Find.Execute = False i = i + 1 Selection.MoveRight Unit:=wdCharacter, Count:=1 Selection.MoveDown Unit:=wdParagraph, Count:=999999999, Extend:=wdExtend Selection.Cut Selection.TypeBackspace ActiveDocument.SaveAs "File_" & VBA.Format(i, "000") & ".doc", 0 ActiveDocument.Close Documents.Add DocumentType:=wdNewBlankDocument Selection.Paste ActiveDocument.Range(0, 0).SelectLoop ActiveDocument.SaveAs "File_" & VBA.Format(i + 1, "000") & ".doc", 0Application.ScreenUpdating = TrueEnd Sub