Re: split msWord Document



Try the following (Save you document first, it has not been tested!):

Dim Source As Document, target As Document, myrange As Range, i As Long
Set Source = ActiveDocument
i = 1
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="yourkeyword", MatchWildcards:=False,
Wrap:=wdFindContinue, Forward:=True) = True
Set myrange = Selection.Range
myrange.Start = Source.Start
myrange.Cut
Set target = Documents.Add
target.Range.Paste
target.SaveAs "doc" & i
i = i + 1
Loop
End With


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
"Bilal Niaz" <Bilal Niaz@xxxxxxxxxxxxxxxxxxxxxxxxx> wrote in message
news:8A773089-AB92-495A-91E3-FB8D2BF54C2B@xxxxxxxxxxxxxxxx
> Hi,
>
> I want to split my single word document into multiple word documents or
> images. The number of peices depend upone a particular keyword.
>
> When ever there is a keyword all the upper portion will be saved to
> another
> word document.
>
> I have been tryin to do it through VB. But, still could not find a
> solution.
>
> Hope to have cooperation.
>
> Thanks,
>
> Bilal
>
> P.S: The word document contains chines charactors too along with english
> charactors, and also the images.


.