Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
oakleyp2
 
Posts: n/a
Default From Access to Word merge


Office 2003 - WinXP

I have an access database that sends data to a word template. When i
click on the button to merge it take longer than it seems it should. i
see a few so called alerts at the bottom of the screen..

"starting microsoft access"
"waiting for microsoft acces to accept dde commands"
"initializing dde link with microsoft access"

then it does the merge. bleow is the code. can somene tell me how to
do this in a more efficient manner???

oDoc.MailMerge.OpenDataSource _
Name:="C:\re\support.mdb", _
Connection:="TABLE tblSUPPORT", _
SQLStatement:="SELECT * From tblSUPPORT", _
Subtype:=wdMergeSubTypeWord2000

With oDoc.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True

With .DataSource
.FirstRecord = Forms!frmSupport.CurrentRecord
.LastRecord = Forms!frmSupport.CurrentRecord
End With

.Execute Pause:=True

End With


--
oakleyp2Posted from - http://www.officehelp.in

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M -WordMVP-
 
Posts: n/a
Default From Access to Word merge

Hi Oakleyp2,

Office 2003 - WinXP

I have an access database that sends data to a word template. When i
click on the button to merge it take longer than it seems it should. i
see a few so called alerts at the bottom of the screen..

"starting microsoft access"
"waiting for microsoft acces to accept dde commands"
"initializing dde link with microsoft access"

then it does the merge. bleow is the code. can somene tell me how to
do this in a more efficient manner???

More efficient would certainly be an ODBC connection, rather than DDE.
DDE is going to be slow because it has to communicate with the Access
application interface. ODBC "talks" directly with the data. The downside
of this is that you won't pick up any of the numeric or date formats, and
you can't use parameter queries or queries that use VBA functions you
define in your database.

In order to test the ODBC connection (and record a macro with the correct
syntax) you need to activate "confirm conversions on open" in
Tools/Options/General. You can then select the connection method after
choosing the *.mdb file.

oDoc.MailMerge.OpenDataSource _
Name:="C:\re\support.mdb", _
Connection:="TABLE tblSUPPORT", _
SQLStatement:="SELECT * From tblSUPPORT", _
Subtype:=wdMergeSubTypeWord2000

With oDoc.MailMerge
.Destination = wdSendToNewDocument
.MailAsAttachment = False
.MailAddressFieldName = ""
.MailSubject = ""
.SuppressBlankLines = True

With .DataSource
.FirstRecord = Forms!frmSupport.CurrentRecord
.LastRecord = Forms!frmSupport.CurrentRecord
End With

.Execute Pause:=True

End With


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question or
reply in the newsgroup and not by e-mail :-)

  #3   Report Post  
Posted to microsoft.public.word.mailmerge.fields
oakleyp2
 
Posts: n/a
Default From Access to Word merge


is this not how i would do it??

oDoc.MailMerge.OpenDataSource _
Name:="", _
connection:="DSN=forms;DBQ=c:\re\support.mdb;", _
SQLStatement:="SELECT * FROM tblsupport", _
Subtype:=wdMergeSubTypeWord2000


--
oakleyp2Posted from - http://www.officehelp.in

  #4   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Cindy M -WordMVP-
 
Posts: n/a
Default From Access to Word merge

Hi Oakleyp2,

is this not how i would do it??

oDoc.MailMerge.OpenDataSource _
Name:="", _
connection:="DSN=forms;DBQ=c:\re\support.mdb;", _
SQLStatement:="SELECT * FROM tblsupport", _
Subtype:=wdMergeSubTypeWord2000

This looks like it could work. I'm not sure I'd expect to
see wdMergeSubTypeWord2000, but if it works, it works :-)

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Jun 8 2004)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:-)

Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I set right and left alignment on the same line in Word? Matador Page Layout 1 November 9th 05 08:32 PM
Legacy Access2/VB4 app merge errors with Word 11 ITJRW Mailmerge 0 January 29th 05 05:30 PM
Web-Site-based Word Mail Merge & Access DB Alex Maghen Mailmerge 3 January 17th 05 09:52 PM
How do I create & merge specific data base & master documents? maggiev New Users 2 January 12th 05 11:30 PM
Word mail merge with Access Linda Mailmerge 1 December 7th 04 11:46 PM


All times are GMT +1. The time now is 08:20 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"