A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Mailmerge
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Mail Merge Subject Line



 
 
Thread Tools Display Modes
  #1  
Old February 24th, 2010, 07:22 AM posted to microsoft.public.word.mailmerge.fields
Tom Ventouris
external usenet poster
 
Posts: 186
Default Mail Merge Subject Line

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?
  #2  
Old February 24th, 2010, 07:38 AM posted to microsoft.public.word.mailmerge.fields
Graham Mayor
external usenet poster
 
Posts: 18,297
Default Mail Merge Subject Line

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" wrote in message
...
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?



  #3  
Old February 24th, 2010, 08:59 AM posted to microsoft.public.word.mailmerge.fields
Peter Jamieson
external usenet poster
 
Posts: 4,550
Default Mail Merge Subject Line

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(strSubjectFiel dName).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

On 24/02/2010 07:22, 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?

  #4  
Old February 24th, 2010, 10:12 AM posted to microsoft.public.word.mailmerge.fields
Tom Ventouris
external usenet poster
 
Posts: 186
Default Mail Merge Subject Line

Thanks. This is exactly what I was looking for

"Peter Jamieson" wrote:

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(strSubjectFiel dName).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

On 24/02/2010 07:22, 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?

.

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 07:22 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.