How can I force an excel spreadsheet to be opened in word mailmergge as DDE?

B

Bruce

I need to always merge from one excel spread sheet. One feild is larger that
256 char and so I need to open the speadsheet in DDE mode. Is there a way I
can force this to happen? I know abbout manually selecting DDE when I run
merge, but I am trying to automate this as much as possible, so I am TRYING
to do this with a macro...

Here is the macro I recorded trying to do it, but when I run it, is is not
in DDE mode:.(

Sub OpenInvoice()
'
' OpenInvoice Macro
' Macro recorded 12/21/2006 by
'
Documents.Add Template:= _
"C:\Documents and Settings\Bruce\Application
Data\Microsoft\Templates\Notary Invoice and worksheet.dot" _
, NewTemplate:=False, DocumentType:=0
ActiveDocument.MailMerge.OpenDataSource Name:= _
"C:\Documents and Settings\Bruce\My Documents\Notary - Closing
Paperwork\Notary Info2.xls" _
, ConfirmConversions:=True, ReadOnly:=False, LinkToSource:=True, _
AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="",
_
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False,
_
Format:=wdOpenFormatAuto, Connection:="Entire Spreadsheet",
SQLStatement _
:="", SQLStatement1:="", SubType:=wdMergeSubTypeOther
End Sub
 
P

Peter Jamieson

Try:

ActiveDocument.MailMerge.OpenDataSource _
Name:="C:\Documents and Settings\Bruce\My Documents\Notary - Closing
Paperwork\Notary Info2.xls", _
Connection:="Entire Spreadsheet", _
SQLStatement:="", _
SubType:=wdMergeSubTypeWord2000

If that doesn't work, it's probably a question of putting the correct SQL in
SQLStatement...

Peter Jamieson
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top