View Single Post
 
Old 12-29-2015, 06:36 AM
jmo jmo is offline Windows 7 32bit Office 2010 32bit
Novice
 
Join Date: Dec 2015
Posts: 7
jmo is on a distinguished road
Default Merge Object and not displaying Access Queries with VBA

Sorry, I included this code in my first post but didn't tag it as such.

Code:
ActiveDocument.MailMerge.OpenDataSource Name:=dbpath, ConfirmConversions:=True, 
ReadOnly:=False, LinkToSource:=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", 
WritePasswordDocument:="", WritePasswordTemplate:="", Revert:=False, Connection:="", 
Format:=wdOpenFormatAuto, SubType:=wdMergeSubType2000
The database queries in the access document utilize access-basic for some calculations (such as turning numbers into words for contracting or calculating the number of months between two date fields). The only way I've been able to get them to appear as an option for a standard mail merge is by selecting DDE.

I tried the sample code you provided but when I copy the statement(s) it provides and then execute the merge the access basic functions, date, and number fields lose their formatting (as if the 'confirm file format' option box was not checked).

Is there a way to manually set a DDE connection or have it pop up the box to select the connection type as it does when you manually step through the merge with the tool-bar buttons?
Reply With Quote