View Single Post
  #3   Report Post  
anton
 
Posts: n/a
Default

Peter what you tel me is the thing i do daily 1 letter for 600 policy , but
i want this for 10 different letters , merge this 10 times is a lot of work
, i was trying to make a macro for it but I can't filter during de macro
because of de SQL statement , I can't say I want kolom 4 and filter on
number 4

my macro looks like this , i am using word 2003 , excel 2003 system xp


Sub Macro4()
'
' Macro4 Macro
' Macro opgenomen op 4 april 2005 door anton pc
'
ActiveDocument.MailMerge.MainDocumentType = wdFormLetters
ActiveDocument.MailMerge.OpenDataSource Name:= _
"F:\backup cd\excelbestanden\Map1\Map1.xls",
ConfirmConversions:=False, _
ReadOnly:=False, LinkToSource:=True, AddToRecentFiles:=False, _
PasswordDocument:="", PasswordTemplate:="",
WritePasswordDocument:="", _
WritePasswordTemplate:="", Revert:=False, Format:=wdOpenFormatAuto,
_
Connection:= _
"Provider=Microsoft.Jet.OLEDB.4.0;Password="""";Us er ID=Admin;Data
Source=F:\backup cd\excelbestanden\Map1\Map1.xls;Mode=Read;Extended
Properties=""HDR=YES;IMEX=1;"";Jet OLEDB:System database="""";Jet
OLEDB:Registry Path="""";Jet OLEDBatabase Password="""";Jet OLE" _
, SQLStatement:="SELECT * FROM `Blad1$`", SQLStatement1:="",
SubType:= _ XXXXX here i want to filter xxxxxxxx kolom 2 , number 4 or 5
or 6 or 7 ( letter number)
wdMergeSubTypeAccess
End Sub



"Peter Jamieson" schreef in bericht
...
You must know how many different letters there are, so the easiest way is
to construct the letters, set up your Excel sheet as the data source in
each letter, but use the filtering options (and sort options, if
necessary) to choose the records with the matching letter type in Excel.
Then merge each letter in turn. Or write a simple macro to open each
mailmerge letter in turn and merge it.

Peter Jamieson

"anton" wrote in message
l...
I have a question, (Sorry for my english)

I make a lot off mailmerge in Excel and Word together ,with one letter
hundreds at de same time ,but I want to make a mailmerge with more than
one letter , example

Policynumber 1 , letter 1
policynumber 2 , letter 2
policynumber 3 , letter 1
policynumber 4 , letter 4

up to 6 or 8 letters and 600 policynumbers sometimes 100 for letter 1
sometimes 10 letter 2

of corse I can use Sort on de different letters , and then vlookup but
dat is a lot of work , for say 10 letters of letter 4

I was thinking to use somekind off code that trikkert the letter , maybe
macro to start

we don't have MS Acces at our systems