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

Outlook : Run the VBA macro on send button click



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 23rd 08, 04:21 PM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Outlook : Run the VBA macro on send button click

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment attached?

Thanks,
Paresh
Ads
  #2  
Old December 23rd 08, 06:30 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook : Run the VBA macro on send button click



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh

  #3  
Old December 24th 08, 04:51 AM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Outlook : Run the VBA macro on send button click

Thaks for reply Michael. I did not know SendItem event is available. Could
you point me some example where I can use SendItem event?

How would I get the body of mail being sent? and How could I stop sending
mail if it not meets some requirements?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh


  #4  
Old December 24th 08, 12:05 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook : Run the VBA macro on send button click



In the VBA environment, select Application from the left combobox above the
code window, then select ItemSend from the right combobox. That will create
the declaration of the procedure for you. You can read the body from
Item.Body, and set the Cancel argument to True if you want to cancel the
sending process.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 19:51:00 -0800 schrieb masani paresh:

Thaks for reply Michael. I did not know SendItem event is available. Could
you point me some example where I can use SendItem event?

How would I get the body of mail being sent? and How could I stop sending
mail if it not meets some requirements?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem

event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code,

read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh


  #5  
Old December 24th 08, 12:15 PM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Outlook : Run the VBA macro on send button click

Thanks for the reply Michael. Could you please tell me how could I make the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh


  #6  
Old December 27th 08, 03:29 PM posted to microsoft.public.outlook.program_vba
Michael Bauer [MVP - Outlook]
external usenet poster
 
Posts: 1,885
Default Outlook : Run the VBA macro on send button click



Paresh, what form do you talk about? The mentioned VBA code cannot be used
as VBScript behind a custom form.

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Wed, 24 Dec 2008 03:15:01 -0800 schrieb masani paresh:

Thanks for the reply Michael. Could you please tell me how could I make

the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem

event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code,

read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh


  #7  
Old January 9th 09, 08:02 PM posted to microsoft.public.outlook.program_vba
Carol Bell
external usenet poster
 
Posts: 3
Default Outlook : Run the VBA macro on send button click

I found a great macro like you are talking about but I can't remember the
site, but I included the top comment from his macro. Maybe you can do a
search for it.
' VBA program for Outlook, (c) Dan Evans. dan at danevans.co.uk
' Will check if your outgoing email mentions an attachment, but you've
' forgotten to attach it


"masani paresh" wrote:

Thanks for the reply Michael. Could you please tell me how could I make the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment

attached?

Thanks,
Paresh


  #8  
Old February 9th 09, 09:00 AM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Outlook : Run the VBA macro on send button click

Thanks Carol,

The code mentioned by you is available at
http://ezinearticles.com/?The-Bigges...Scam&id=259190

It seems to be very useful and thanks for that. It seems to give false
alarm in below situation:

1. I got a mail which has "attach" word and also has attachment
2. Now if I reply to that mail(just to say thanks) without having
"attach" word as I dont want to attach anything then this macro ask for
attachment.

Could you tell me how to get rid of this.

Thanks,
Paresh

"Carol Bell" wrote:

I found a great macro like you are talking about but I can't remember the
site, but I included the top comment from his macro. Maybe you can do a
search for it.
' VBA program for Outlook, (c) Dan Evans. dan at danevans.co.uk
' Will check if your outgoing email mentions an attachment, but you've
' forgotten to attach it


"masani paresh" wrote:

Thanks for the reply Michael. Could you please tell me how could I make the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment
attached?

Thanks,
Paresh

  #9  
Old February 9th 09, 04:24 PM posted to microsoft.public.outlook.program_vba
Carol Bell
external usenet poster
 
Posts: 3
Default Outlook : Run the VBA macro on send button click

In situations like that I cancel the macro.

You could write some code to see if the line containing the word 'attach' is
preceeded by a but that would work only if your replies are configured
that way.

Or maybe parse the message looking for ----Original Message--- and stop
searching for the word 'attach'.

Good luck

"masani paresh" wrote:

Thanks Carol,

The code mentioned by you is available at
http://ezinearticles.com/?The-Bigges...Scam&id=259190

It seems to be very useful and thanks for that. It seems to give false
alarm in below situation:

1. I got a mail which has "attach" word and also has attachment
2. Now if I reply to that mail(just to say thanks) without having
"attach" word as I dont want to attach anything then this macro ask for
attachment.

Could you tell me how to get rid of this.

Thanks,
Paresh

"Carol Bell" wrote:

I found a great macro like you are talking about but I can't remember the
site, but I included the top comment from his macro. Maybe you can do a
search for it.
' VBA program for Outlook, (c) Dan Evans. dan at danevans.co.uk
' Will check if your outgoing email mentions an attachment, but you've
' forgotten to attach it


"masani paresh" wrote:

Thanks for the reply Michael. Could you please tell me how could I make the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment
attached?

Thanks,
Paresh

  #10  
Old February 10th 09, 06:50 AM posted to microsoft.public.outlook.program_vba
masani paresh[_2_]
external usenet poster
 
Posts: 84
Default Outlook : Run the VBA macro on send button click

I am not sure but there must be some flag got be set for current oMail item
so that we should know the mail is getting forwarded or replied or just new.

Regards,
PAresh

"Carol Bell" wrote:

In situations like that I cancel the macro.

You could write some code to see if the line containing the word 'attach' is
preceeded by a but that would work only if your replies are configured
that way.

Or maybe parse the message looking for ----Original Message--- and stop
searching for the word 'attach'.

Good luck

"masani paresh" wrote:

Thanks Carol,

The code mentioned by you is available at
http://ezinearticles.com/?The-Bigges...Scam&id=259190

It seems to be very useful and thanks for that. It seems to give false
alarm in below situation:

1. I got a mail which has "attach" word and also has attachment
2. Now if I reply to that mail(just to say thanks) without having
"attach" word as I dont want to attach anything then this macro ask for
attachment.

Could you tell me how to get rid of this.

Thanks,
Paresh

"Carol Bell" wrote:

I found a great macro like you are talking about but I can't remember the
site, but I included the top comment from his macro. Maybe you can do a
search for it.
' VBA program for Outlook, (c) Dan Evans. dan at danevans.co.uk
' Will check if your outgoing email mentions an attachment, but you've
' forgotten to attach it


"masani paresh" wrote:

Thanks for the reply Michael. Could you please tell me how could I make the
form default after adding this macro?

Thanks,
Paresh

"Michael Bauer [MVP - Outlook]" wrote:



You could capture the button click, but what about using the SendItem event?

--
Best regards
Michael Bauer - MVP Outlook

: Outlook Categories? Category Manager Is Your Tool
: VBOffice Reporter for Data Analysis & Reporting
: http://www.vboffice.net/product.html?pub=6&lang=en


Am Tue, 23 Dec 2008 07:21:01 -0800 schrieb masani paresh:

Hi Friends,

Is it possible to capture the send button click event from VBA code, read
the body of mail and display message box if there is no attachment
attached?

Thanks,
Paresh

 




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
Getting a button for my VB Script macro in outlook Matt L Outlook and VBA 1 April 10th 08 02:54 AM
Start a macro after clic on "Send" button [email protected] Outlook - General Queries 1 August 10th 07 05:54 PM
can't click To: button when sending attached rtf in outlook 2003 [email protected] Outlook - General Queries 0 February 22nd 07 05:32 PM
Outlook 2007 Click a Button on the Ribbon through Code [email protected] Add-ins for Outlook 5 December 14th 06 09:04 PM
click a button on the toolbar (via VBA?) Dan Outlook and VBA 7 May 2nd 06 10:35 AM


All times are GMT +1. The time now is 01:17 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.