A Microsoft Outlook email forum. Outlook Banter

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 » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Detect Mail Merge from Word



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old January 14th 08, 05:23 PM posted to microsoft.public.outlook.program_vba
Jim Leach
external usenet poster
 
Posts: 3
Default Detect Mail Merge from Word

Hello,

I have a COM Addin for Outlook written in VB6 that detects when items are
added to the SentItems folder's Item collection and potentially displays a
dialog box.

If a user performs a "Mail Merge to E-mail" from Word I want to temporarily
disable my dialog box from showing until the merge is complete.

Is there a way to detect that this mail merge is in progress, from either
the Outlook or Word object models? BTW - I am also using Redemption in my
solution.

Regards,

Jim Leach
Ads
  #2  
Old January 14th 08, 06:55 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Detect Mail Merge from Word

Yes, I believe you can do this. There's a MailMergeBeforeMerge event in Word
you can hook into, but you'll need to have this code running in Word's
context - either as a VBA macro hooked into normal.dot, or as a Word COM
Add-In. When the event fires, you can communicate with your Outlook Add-In.


--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jim Leach" wrote:

Hello,

I have a COM Addin for Outlook written in VB6 that detects when items are
added to the SentItems folder's Item collection and potentially displays a
dialog box.

If a user performs a "Mail Merge to E-mail" from Word I want to temporarily
disable my dialog box from showing until the merge is complete.

Is there a way to detect that this mail merge is in progress, from either
the Outlook or Word object models? BTW - I am also using Redemption in my
solution.

Regards,

Jim Leach

  #3  
Old January 14th 08, 08:48 PM posted to microsoft.public.outlook.program_vba
Jim Leach
external usenet poster
 
Posts: 3
Default Detect Mail Merge from Word

Thanks for your reply Eric,

I was HOPING I could detect the mail merge from the Outlook side... :-)

Is there perhaps some property of the Sent Item I can get at with Redemption
that would tell me it is the product of a mail merge?

Regards,

Jim Leach

"Eric Legault [MVP - Outlook]" wrote:

Yes, I believe you can do this. There's a MailMergeBeforeMerge event in Word
you can hook into, but you'll need to have this code running in Word's
context - either as a VBA macro hooked into normal.dot, or as a Word COM
Add-In. When the event fires, you can communicate with your Outlook Add-In.


--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jim Leach" wrote:

Hello,

I have a COM Addin for Outlook written in VB6 that detects when items are
added to the SentItems folder's Item collection and potentially displays a
dialog box.

If a user performs a "Mail Merge to E-mail" from Word I want to temporarily
disable my dialog box from showing until the merge is complete.

Is there a way to detect that this mail merge is in progress, from either
the Outlook or Word object models? BTW - I am also using Redemption in my
solution.

Regards,

Jim Leach

  #4  
Old January 14th 08, 09:35 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Detect Mail Merge from Word

I think you can detect the mail merge from Outlook as well - just declare
this in your module:

Private WithEvents objWord As Word.Application

Then you can work with the event:

Private Sub objWord_MailMergeBeforeMerge(ByVal Doc As Word.Document, ByVal
StartRecord As Long, ByVal EndRecord As Long, Cancel As Boolean)

End Sub

You just need to set objWord to a new or existing instance of Word when you
need to start monitoring for a mail merge.

I don't know off-hand if there are any unique properties put into an e-mail
if it was created with a mail merge. If you took control of the process, you
could do that yourself.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Eric Legault [MVP - Outlook]" wrote:

Yes, I believe you can do this. There's a MailMergeBeforeMerge event in Word
you can hook into, but you'll need to have this code running in Word's
context - either as a VBA macro hooked into normal.dot, or as a Word COM
Add-In. When the event fires, you can communicate with your Outlook Add-In.


--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jim Leach" wrote:

Hello,

I have a COM Addin for Outlook written in VB6 that detects when items are
added to the SentItems folder's Item collection and potentially displays a
dialog box.

If a user performs a "Mail Merge to E-mail" from Word I want to temporarily
disable my dialog box from showing until the merge is complete.

Is there a way to detect that this mail merge is in progress, from either
the Outlook or Word object models? BTW - I am also using Redemption in my
solution.

Regards,

Jim Leach

  #5  
Old January 14th 08, 09:42 PM posted to microsoft.public.outlook.program_vba
Eric Legault [MVP - Outlook]
external usenet poster
 
Posts: 830
Default Detect Mail Merge from Word

Whoops - I replied to my reply by accident, in case you miss my response.

--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jim Leach" wrote:

Thanks for your reply Eric,

I was HOPING I could detect the mail merge from the Outlook side... :-)

Is there perhaps some property of the Sent Item I can get at with Redemption
that would tell me it is the product of a mail merge?

Regards,

Jim Leach

"Eric Legault [MVP - Outlook]" wrote:

Yes, I believe you can do this. There's a MailMergeBeforeMerge event in Word
you can hook into, but you'll need to have this code running in Word's
context - either as a VBA macro hooked into normal.dot, or as a Word COM
Add-In. When the event fires, you can communicate with your Outlook Add-In.


--
Eric Legault - Outlook MVP, MCDBA, MCTS (SharePoint programming, etc.)
Try Picture Attachments Wizard for Outlook:
http://www.collaborativeinnovations.ca
Blog: http://blogs.officezealot.com/legault/


"Jim Leach" wrote:

Hello,

I have a COM Addin for Outlook written in VB6 that detects when items are
added to the SentItems folder's Item collection and potentially displays a
dialog box.

If a user performs a "Mail Merge to E-mail" from Word I want to temporarily
disable my dialog box from showing until the merge is complete.

Is there a way to detect that this mail merge is in progress, from either
the Outlook or Word object models? BTW - I am also using Redemption in my
solution.

Regards,

Jim Leach

 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
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 On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
mail merge from Word skeddy Outlook - General Queries 4 September 5th 07 03:51 AM
Mail Merge from Outlook to Word Khiva Outlook - General Queries 1 December 16th 06 03:26 AM
Using the mail merge in word dillon65 Outlook - Using Contacts 1 December 12th 06 08:59 PM
How to direct output from Word mail merge to multiple Word documents [email protected] Outlook - General Queries 3 August 11th 06 04:10 AM
E-Mail Merge in Word Lucie Chénier Outlook - General Queries 5 May 5th 06 12:02 AM


All times are GMT +1. The time now is 02:26 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.