![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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
|
|||
|
|||
![]()
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 |
Display Modes | |
|
|
![]() |
||||
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 |