PC Review


Reply
Thread Tools Rate Thread

Add the macro in new mail form

 
 
masani paresh
Guest
Posts: n/a
 
      24th Dec 2008
Hi,

I want to write macro on Send_Item() event. I have two below questions.
Could any one please help me out.

1. How to make new mail form default?
2. If certain condition not satiesfied then mail should not send and new
mail window should stay as it is. How could I canceled the sending mail?

Thanks,
Paresh
 
Reply With Quote
 
 
 
 
Ken Slovak - [MVP - Outlook]
Guest
Posts: n/a
 
      24th Dec 2008
See http://www.outlookcode.com/article.aspx?id=39 for how to make a form the
default for that type of item.

You want to handle the Item.Send event or the Application_ItemSend event?
The first is specific to that item and you'd need a handle to the item to be
able to subscribe to its Send event. The second is global to Outlook and
fires whenever any item is sent. Both have Cancel arguments that if set to
True will cancel the send.

So if your conditions don't test out in the event handler you can set Cancel
= True and leave the item unsent. Using the item.Send event will leave the
item open. Using Application_ItemSend will not since the item was already
sent out and now is being submitted to the mail transport.

You can search on www.outlookcode.com for examples of using both events. In
the case of item.Send you will need to subscribe to Inspectors.NewInspector
to be able to handle the opening of an item and then if it's a mail item you
can set up to handle the Inspector.CurrentItem which will be the mail item.
Then you need to subscribe to the Send event for that item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"masani paresh" <(E-Mail Removed)> wrote in message
newsA91054F-2053-4497-A51E-(E-Mail Removed)...
> Hi,
>
> I want to write macro on Send_Item() event. I have two below questions.
> Could any one please help me out.
>
> 1. How to make new mail form default?
> 2. If certain condition not satiesfied then mail should not send and new
> mail window should stay as it is. How could I canceled the sending mail?
>
> Thanks,
> Paresh


 
Reply With Quote
Reply

Thread Tools
Rate This Thread
Rate This Thread:

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

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Spell Check a protected Form with a Macro & already have forms picture macro slsjmc@yahoo.com Microsoft Word Document Management 2 25th Oct 2007 04:11 PM
Macro doesn't work on form or Macro timing and locked table Mike Microsoft Access 1 25th May 2007 03:47 PM
Macro: add / create an e-mail button to my mw form =?Utf-8?B?UHJvdGVjdGVkIEV4Y2VsIExpc3RzLi4uLkhFTFAh Microsoft Word Document Management 0 20th Oct 2006 09:39 PM
using a macro to mail a form =?Utf-8?B?Y2Fyb2xt?= Microsoft Access Forms 0 24th May 2004 10:21 AM
Use Macro to Mail Form Bill Microsoft Word New Users 1 14th Oct 2003 10:39 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 11:56 PM.