Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Mail Merge Subject Line

1,165 views
Skip to first unread message

Tom Ventouris

unread,
Feb 24, 2010, 2:22:01 AM2/24/10
to
I have a mail merge with tables in MS Access.
Is there any way to select the subject line on the screen that pops up when
I click Send E Mail Messages from a Field in the merged data?

Graham Mayor

unread,
Feb 24, 2010, 2:38:46 AM2/24/10
to
If you mean different subject lines for each record, when using the mail
merge tools in Word then no. The pop-up does give the option to provide a
common subject.
If you are using Outlook to send the messages then Outlook can be programmed
from Word vba, so you could create a 'roll your own' merge function.
MAPILab's Mailmerge toolkit add-in for Outlook
http://www.mapilab.com/outlook/mail_merge/ adds this ability and more should
you wish to employ a commercial solution.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com
Word MVP web site http://word.mvps.org
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>


"Tom Ventouris" <TomVen...@discussions.microsoft.com> wrote in message
news:ACA8F124-30E2-4921...@microsoft.com...

Peter Jamieson

unread,
Feb 24, 2010, 3:59:54 AM2/24/10
to

If you are familiar with VBA, you can use Word's MailMerge events and
VBA to specify the subject for each email.
e.g. in the VBA Editor, Insert a new Class Module, name it
EventClassModule, and insert the following code:

Public WithEvents App As Word.Application
Private Sub App_MailMergeBeforeRecordMerge( _
ByVal Doc As Document, _
Cancel As Boolean)
' set this to be the exact name
' of the field you want to use
' (uppercase/lowercase are
' significant here)
Const strSubjectFieldName = "mysubjectfield"
Doc.MailMerge.MailSubject = _
Doc.MailMerge.DataSource.DataFields(strSubjectFieldName).Value
End Sub

In an ordinary module, put the following VBA
'---
Dim x As New EventClassModule
Sub MergeWithEvents()
EnableEventHandler
' Do the merge
ActiveDocument.MailMerge.Execute Pause:=False
' The events fire for all documents
' so disable them
DisableEventHandler
End Sub

Sub EnableEventHandler()
Set x.App = Word.Application
End Sub

Sub DisableEventHandler()
Set x.App = Nothing
End Sub
'---
Then, with your mail merge main document open, run the MergeWithEvents
subroutine to run your merge

Peter Jamieson

http://tips.pjmsn.me.uk

Tom Ventouris

unread,
Feb 24, 2010, 5:12:01 AM2/24/10
to

Thanks. This is exactly what I was looking for

"Peter Jamieson" wrote:

> .
>

Domenico Ferraro

unread,
Sep 30, 2010, 12:51:13 PM9/30/10
to
Is there anyway possible that you can kindy guide me on how to get this to work? I've tried everything possible and I just can't seem to get this to work.

Any help is greatfully appreciated!

Thanks =)

> On Wednesday, February 24, 2010 2:22 AM Tom Ventouris wrote:

> I have a mail merge with tables in MS Access.
> Is there any way to select the subject line on the screen that pops up when
> I click Send E Mail Messages from a Field in the merged data?


>> On Wednesday, February 24, 2010 2:38 AM Graham Mayor wrote:

>> If you mean different subject lines for each record, when using the mail
>> merge tools in Word then no. The pop-up does give the option to provide a
>> common subject.
>> If you are using Outlook to send the messages then Outlook can be programmed
>> from Word vba, so you could create a 'roll your own' merge function.
>> MAPILab's Mailmerge toolkit add-in for Outlook
>> http://www.mapilab.com/outlook/mail_merge/ adds this ability and more should
>> you wish to employ a commercial solution.
>>
>> --
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>
>> Graham Mayor - Word MVP
>>
>> My web site www.gmayor.com
>> Word MVP web site http://word.mvps.org
>> <>>< ><<> ><<> <>>< ><<> <>>< <>><<>


>>>> On Wednesday, February 24, 2010 5:12 AM Tom Ventouris wrote:

>>>> Thanks. This is exactly what I was looking for
>>>>
>>>> "Peter Jamieson" wrote:


>>>> Submitted via EggHeadCafe - Software Developer Portal of Choice
>>>> Why GUIDs are not a good idea for SQL Server Primary Keys
>>>> http://www.eggheadcafe.com/tutorials/aspnet/d662b371-ed27-481c-aee0-ebe7cf2d9fad/why-guids-are-not-a-good-idea-for-sql-server-primary-keys.aspx

0 new messages