Reply
 
Thread Tools Display Modes
  #1   Report Post  
jonmarcr
 
Posts: n/a
Default Mail Merge Macros

We wrote macros to link up to one of four "mail queues" derived from our
access database. In Office 97 and then in Office 2000 they worked well but
in office 2003 we simply cannot get them to work properly.

The old syntax was:

Sub Merge1Q()
'
' Merge_1 Macro
' Macro recorded 08/05/2004 by Jon Marc
'
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [Qry-MAILSHOT ADDRESSES] WHERE (([Mail_Merge_1] =
-1))" & _
""
End Sub

This now gives us run time error 4198

The data source for this user is: MAIL MERGE DATA (JMR) Qry-MAILSHOT
ADDRESSES (in "My data sources" folder)

(each user has his own sub-table and so another user will have MAIL MERGE
DATA (PEC) Qry-MAILSHOT ADDRESSES and so on.

Within each table there are all the addresses selected for the 4 possible
mailshots and by manually selecting queue=-1 for either 1,2,3 or 4 we can get
it to work. However we simply want a macro to do this for us to avoid
errors.

Can anyone help please?
--
jon
  #2   Report Post  
Karen Hart
 
Posts: n/a
Default

Every MSAccess data source I had from 97 was named something.txt. I had to
change them all to something.doc for the merges to work after upgrading to
Access XP.
Hope that helps.
Karen Hart

"jonmarcr" wrote in message
...
We wrote macros to link up to one of four "mail queues" derived from our
access database. In Office 97 and then in Office 2000 they worked well
but
in office 2003 we simply cannot get them to work properly.

The old syntax was:

Sub Merge1Q()
'
' Merge_1 Macro
' Macro recorded 08/05/2004 by Jon Marc
'
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [Qry-MAILSHOT ADDRESSES] WHERE (([Mail_Merge_1] =
-1))" & _
""
End Sub

This now gives us run time error 4198

The data source for this user is: MAIL MERGE DATA (JMR) Qry-MAILSHOT
ADDRESSES (in "My data sources" folder)

(each user has his own sub-table and so another user will have MAIL MERGE
DATA (PEC) Qry-MAILSHOT ADDRESSES and so on.

Within each table there are all the addresses selected for the 4 possible
mailshots and by manually selecting queue=-1 for either 1,2,3 or 4 we can
get
it to work. However we simply want a macro to do this for us to avoid
errors.

Can anyone help please?
--
jon



  #3   Report Post  
Peter Jamieson
 
Posts: n/a
Default

Assuming that you are not seeing a problem that has the same cause and
solution as is described in the following article:

http://support.microsoft.com/default...b;en-us;825765

I would

a. ensure that Word can "see" the query "Qry-MAILSHOT ADDRESSES" when you
try to connect to the data source manually. The problem is that the old
connection method used by default in Word 2000 and earlier (DDE) let Word
use most queries. The new default (OLEDB) excludes a number of types of
query. You can revert to DDE by checking Word Tools|Options|General|COnfirm
conversions at open and going through the connection process again, or using
the parameter Subtype:=wdMergeSubtypeWord2000 in your OpenDataSource call.
You might also need to use that parameter if you were opening the data
source using ODBC.
b. try changing the query syntax to use a table alias, e.g. something like

SELECT q.* FROM [Qry-MAILSHOT ADDRESSES] q WHERE ((q.[Mail_Merge_1] =
-1))


Peter Jamieson
"jonmarcr" wrote in message
...
We wrote macros to link up to one of four "mail queues" derived from our
access database. In Office 97 and then in Office 2000 they worked well
but
in office 2003 we simply cannot get them to work properly.

The old syntax was:

Sub Merge1Q()
'
' Merge_1 Macro
' Macro recorded 08/05/2004 by Jon Marc
'
ActiveDocument.MailMerge.DataSource.QueryString = _
"SELECT * FROM [Qry-MAILSHOT ADDRESSES] WHERE (([Mail_Merge_1] =
-1))" & _
""
End Sub

This now gives us run time error 4198

The data source for this user is: MAIL MERGE DATA (JMR) Qry-MAILSHOT
ADDRESSES (in "My data sources" folder)

(each user has his own sub-table and so another user will have MAIL MERGE
DATA (PEC) Qry-MAILSHOT ADDRESSES and so on.

Within each table there are all the addresses selected for the 4 possible
mailshots and by manually selecting queue=-1 for either 1,2,3 or 4 we can
get
it to work. However we simply want a macro to do this for us to avoid
errors.

Can anyone help please?
--
jon



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
Mail Merge Word 2003 Issue S.Nicks Mailmerge 5 February 20th 09 01:55 AM
mail merge with attachments AS Mailmerge 5 April 9th 05 09:49 AM
Proteced Form with Mail Merge Section-Mail Merge is "lost" whe F. Ferrer Microsoft Word Help 0 February 2nd 05 08:27 PM
Word-Excel 2003 - Mail Merge Recipients problem AYager Mailmerge 2 January 11th 05 04:11 AM
Using Hyperlinks in Mail Merge IF...THEN...ELSE Statements Mark V Mailmerge 8 November 30th 04 01:31 PM


All times are GMT +1. The time now is 09:17 AM.

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"