R
Ralf Pickel
hi,
mailmerge automation works fine when file extension of excel file is xls.
with other extension it will not. what can i do? renaming the file is not a
solution!
the solution must work with word 2000, XP, 2003.
i'd like to use dde (sample2).
thanks
ralf
code samples for word 2003 (german)
sample1:
oMailMerge.OpenDataSource _
Name:=Filename _
, ConfirmConversions:=False _
, ReadOnly:=False _
, LinkToSource:=True _
, AddToRecentFiles:=False _
, PasswordDocument:="" _
, PasswordTemplate:="" _
, WritePasswordDocument:="" _
, WritePasswordTemplate:="" _
, Revert:=False _
, Format:=wdOpenFormatAuto _
, Connection:="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Filename & ";Extended Properties=Excel 8.0;" _
, SQLStatement:="SELECT * FROM `Tabelle1$`" _
, SQLStatement1:="" _
, SubType:=wdMergeSubTypeOther
sample2:
oMailMerge.OpenDataSource Name:=Filename, _
Format:=CLng(0), _
ConfirmConversions:=CLng(0), _
ReadOnly:=CLng(1), _
LinkToSource:=CLng(0), _
AddToRecentFiles:=CLng(0), _
PasswordDocument:="", _
PasswordTemplate:="", _
Revert:=CLng(0), _
WritePasswordDocument:="", _
WritePasswordTemplate:="", _
Connection:="Gesamte Arbeitsmappe", _
SQLStatement:="", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeWord2000
mailmerge automation works fine when file extension of excel file is xls.
with other extension it will not. what can i do? renaming the file is not a
solution!
the solution must work with word 2000, XP, 2003.
i'd like to use dde (sample2).
thanks
ralf
code samples for word 2003 (german)
sample1:
oMailMerge.OpenDataSource _
Name:=Filename _
, ConfirmConversions:=False _
, ReadOnly:=False _
, LinkToSource:=True _
, AddToRecentFiles:=False _
, PasswordDocument:="" _
, PasswordTemplate:="" _
, WritePasswordDocument:="" _
, WritePasswordTemplate:="" _
, Revert:=False _
, Format:=wdOpenFormatAuto _
, Connection:="Provider=Microsoft.Jet.OLEDB.4.0;Data
Source=" & Filename & ";Extended Properties=Excel 8.0;" _
, SQLStatement:="SELECT * FROM `Tabelle1$`" _
, SQLStatement1:="" _
, SubType:=wdMergeSubTypeOther
sample2:
oMailMerge.OpenDataSource Name:=Filename, _
Format:=CLng(0), _
ConfirmConversions:=CLng(0), _
ReadOnly:=CLng(1), _
LinkToSource:=CLng(0), _
AddToRecentFiles:=CLng(0), _
PasswordDocument:="", _
PasswordTemplate:="", _
Revert:=CLng(0), _
WritePasswordDocument:="", _
WritePasswordTemplate:="", _
Connection:="Gesamte Arbeitsmappe", _
SQLStatement:="", _
SQLStatement1:="", _
SubType:=wdMergeSubTypeWord2000