Hi Edgar,
If you run a macro containing the following code when the document is
active, it will save each portion as a separate document with the
filename
being the supplier reference:
Dim Source As Document, Target As Document, arange As Range, fname As
String
Set Source = ActiveDocument
Selection.EndKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
Do While .Execute(FindText:="1[0-9]{5}", MatchWildcards:=True,
Wrap:=wdFindContinue, Forward:=False) = True
Set arange = Selection.Range
fname = arange.Text
arange.End = Source.Range.End
Set Target = Documents.Add
Target.Range = arange
arange.Delete
Target.SaveAs fname
Target.Close
Loop
End With
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
Edgar said:
Hi
The supplier reference will be a 6 digit number starting
with a 1. Let me know if you need any more info.
E
-----Original Message-----
Edgar,
Give us some more information about how the supplier reference can be
identified.
--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.
Hope this helps
Doug Robbins - Word MVP
Hi
Not sure if this is possible but i have a large document
that is generated from Crystal Reports and is saved in rtf
format.
This report is lots of different remittances for suppliers
but we cannot split this up to individual suppliers from
Crystal so at the moment we are forced to email page
ranges which is very time consuming.
The problem is the remittances range from 1 page to 15
pages so i would need to set up some kind of loop to check
the supplier reference and then for it to save as the
supplier reference.
The supplier reference is always in the same place on the
document so is it possible to set a marker on this to be
used in a loop. Sorry but i know next to nothing about
word vba. Thanks in advance for your help.
Edgar