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

Send and delete button



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old December 22nd 06, 11:44 AM posted to microsoft.public.outlook.program_vba
DannyJ
external usenet poster
 
Posts: 10
Default Send and delete button

Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny
  #2  
Old December 22nd 06, 01:38 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Send and delete button

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny

  #3  
Old January 6th 07, 08:45 AM posted to microsoft.public.outlook.program_vba
DannyJ
external usenet poster
 
Posts: 10
Default Send and delete button

Thank you Sue,

You are a star!

Best wishes for the new year.

Danny

"Sue Mosher [MVP-Outlook]" wrote:

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny


  #4  
Old January 6th 07, 09:03 AM posted to microsoft.public.outlook.program_vba
DannyJ
external usenet poster
 
Posts: 10
Default Send and delete button .....hmmm

Hi Sue,

It works fantastically in Outlook.....but not if Word is the email editor.
Also I was wondering if it is possible to get round the "a program is trying
to send an email" message box.

Stillk I love it, it will save a lot of time.

Best wishes,

Danny

"Sue Mosher [MVP-Outlook]" wrote:

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny


  #5  
Old January 6th 07, 01:06 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Send and delete button .....hmmm

It works fantastically in Outlook.....but not if Word is the email editor.

If you want the code to run from Word VBA, you'd need to instantiate an Outlook Application object with CreateObject:

Set objOL = CreateObject("Outlook.Application")
Set msg =objOL.ActiveInspector.CurrentItem

etc.

Also I was wondering if it is possible to get round the "a program is trying
to send an email" message box.


See http://www.outlookcode.com/d/sec.htm for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions.



--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Sue Mosher [MVP-Outlook]" wrote:

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny


  #6  
Old January 8th 07, 11:41 AM posted to microsoft.public.outlook.program_vba
DannyJ
external usenet poster
 
Posts: 10
Default Thank and....

Dear Sue,

Thank you. I did not know you had a book out. Given that my knowledge of
VBA is a 3 day course in Excel Macros and VBA (and your explanation above
made me want to hide behind the sofa), would your book be too advanced for
me? I am pretty good at using MS Office ....but pretty rubbish at programming.

Danny

"Sue Mosher [MVP-Outlook]" wrote:

It works fantastically in Outlook.....but not if Word is the email editor.


If you want the code to run from Word VBA, you'd need to instantiate an Outlook Application object with CreateObject:

Set objOL = CreateObject("Outlook.Application")
Set msg =objOL.ActiveInspector.CurrentItem

etc.

Also I was wondering if it is possible to get round the "a program is trying
to send an email" message box.


See http://www.outlookcode.com/d/sec.htm for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions.



--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Sue Mosher [MVP-Outlook]" wrote:

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny


  #7  
Old January 8th 07, 12:12 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default Thank and....

My book would probably be just the right level to build on what you already know.

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003
http://www.turtleflock.com/olconfig/index.htm
and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx

"DannyJ" wrote in message news
Dear Sue,

Thank you. I did not know you had a book out. Given that my knowledge of
VBA is a 3 day course in Excel Macros and VBA (and your explanation above
made me want to hide behind the sofa), would your book be too advanced for
me? I am pretty good at using MS Office ....but pretty rubbish at programming.

Danny

"Sue Mosher [MVP-Outlook]" wrote:

It works fantastically in Outlook.....but not if Word is the email editor.


If you want the code to run from Word VBA, you'd need to instantiate an Outlook Application object with CreateObject:

Set objOL = CreateObject("Outlook.Application")
Set msg =objOL.ActiveInspector.CurrentItem

etc.

Also I was wondering if it is possible to get round the "a program is trying
to send an email" message box.


See http://www.outlookcode.com/d/sec.htm for your options with regard to the "object model guard" security in Outlook 2000 SP2 and later versions.

"Sue Mosher [MVP-Outlook]" wrote:

Sub SendIt
On Error Resume Next
Set msg = Application.ActiveInspector.CurrentItem
msg.DeleteAfterSubmit = True
msg.Send
End Sub

"DannyJ" wrote in message ...
Hi folks,

I would really like to create a button that sends the email and then deletes
it from the sent items folder. This would be really useful for getting rid
of emails that just say "thanks" etc.

Any ideas?

Many thanks,

Danny


 




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
delete button Debbie Outlook Express 4 October 10th 06 09:36 PM
Some items can't be send in outlook 2003. Even after repeatly clicking the send button. baarts Outlook - General Queries 1 August 9th 06 02:52 PM
Delete Button grayed out......... §hirley Outlook Express 8 July 16th 06 09:40 PM
Delete Excel Command Button Before Email is Sent White Horse Outlook and VBA 1 April 28th 06 06:01 AM
How do I modify Delete button to also mark item as read? [email protected] Outlook and VBA 1 April 24th 06 06:14 AM


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