Send and delete button

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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
 
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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
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
 
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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
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
 
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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
DannyJ,

Any chance you could post those steps here? I'm kinda basic with this,
but it would suit my needs exactly.
 
Danny,

Sure, it's jonathan[dot]livingston[at]gmail[dot]com.

Thanks a ton I really appreciate it!

- Jonathan
 
Hi Danny,

Unfortunately I didn't or at least couldn't find it if it went into my
spam folder.

Any chance you could send it to this address instead:
jl234[at]verizon[dot]net?

Thanks again!

Hi Jonathon,

Did you get them?

Danny,

Sure, it's jonathan[dot]livingston[at]gmail[dot]com.

Thanks a ton I really appreciate it!

- Jonathan
Hi jonathon,

tried to email you the notes but no joy. woudl you confirm your email please?


Danny

:

DannyJ,

Any chance you could post those steps here? I'm kinda basic with this,
but it would suit my needs exactly.


DannyJ wrote:
....that I have created some step by step notes for how to create a send and
delete button for Outlook. These have you and your book in the
acknowledgements and will be available to 1400 people (I am an IT trainer
with a health care organisation).

thank you again,

Danny

:

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

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers


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

:

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.

:

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

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
 
I don't know what you mean by "the reply toolbar." And what specifically doesn't work?

--
Sue Mosher, Outlook MVP
Author of Configuring Microsoft Outlook 2003

and Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
 
Back
Top