Re: split msWord Document
- From: "Doug Robbins" <dkr@xxxxxxxxxxxxxx>
- Date: Mon, 30 May 2005 19:56:30 +0200
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.
.
- Follow-Ups:
- Re: split msWord Document
- From: Bilal Niaz
- Re: split msWord Document
- References:
- split msWord Document
- From: Bilal Niaz
- split msWord Document
- Prev by Date: Re: Autocorrect
- Next by Date: Re: equations
- Previous by thread: split msWord Document
- Next by thread: Re: split msWord Document
- Index(es):
Relevant Pages
|