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

automatically check if attachment was added when sending message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old July 30th 07, 12:09 PM posted to microsoft.public.outlook.program_vba
kkappabear
external usenet poster
 
Posts: 3
Default automatically check if attachment was added when sending message

Hi,
I'm new to VBA and I'm trying to find some relevant links to this
topic. What I'm trying to do is that once user clicks on "send
message" the message will be scanned if it contains any attachments
and if not a popup will show up asking if he wants to add attachment
to the message.
So, what I need to know are informations about adding action to pre-
defined button in outlook, checking if attachment was added and then
regarding the answer on popup send the message or get back to
attachement addition.

Thank you for any help.

Marek Zacik

Ads
  #2  
Old July 30th 07, 12:17 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default automatically check if attachment was added when sending message

Take a look at the sample at http://www.outlookcode.com/codedetail.aspx?id=553

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"kkappabear" wrote in message oups.com...
Hi,
I'm new to VBA and I'm trying to find some relevant links to this
topic. What I'm trying to do is that once user clicks on "send
message" the message will be scanned if it contains any attachments
and if not a popup will show up asking if he wants to add attachment
to the message.
So, what I need to know are informations about adding action to pre-
defined button in outlook, checking if attachment was added and then
regarding the answer on popup send the message or get back to
attachement addition.

Thank you for any help.

Marek Zacik

  #3  
Old July 30th 07, 03:17 PM posted to microsoft.public.outlook.program_vba
kkappabear
external usenet poster
 
Posts: 3
Default automatically check if attachment was added when sending message

I've got no idea what was wrong, anyway it doesn't worked properly, so
I've wrote a simpler version:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

Dim lngres As Long
If Item.Attachments.Count = 0 Then
lngres = MsgBox("No attachments, continue?", _
vbYesNo + vbDefaultButton2 + vbQuestion + vbSystemModal,
"Auto control...")
If lngres = vbNo Then Cancel = True
End If

End Sub

all works fine, but the popup shows in the main outlook window and
once I click to "No" I would like to switch the "New mail" window
back. Is it possible to toggle the new mail window after Cancel=True ?



On 30. Júl, 13:17 h., "Sue Mosher [MVP-Outlook]"
wrote:
Take a look at the sample athttp://www.outlookcode.com/codedetail.aspx?id=553

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54

"kkappabear" wrote in ooglegroups.com...
Hi,
I'm new to VBA and I'm trying to find some relevant links to this
topic. What I'm trying to do is that once user clicks on "send
message" the message will be scanned if it contains any attachments
and if not a popup will show up asking if he wants to add attachment
to the message.
So, what I need to know are informations about adding action to pre-
defined button in outlook, checking if attachment was added and then
regarding the answer on popup send the message or get back to
attachement addition.


Thank you for any help.


Marek Zacik



  #4  
Old August 6th 07, 01:18 PM posted to microsoft.public.outlook.program_vba
Sue Mosher [MVP-Outlook]
external usenet poster
 
Posts: 11,651
Default automatically check if attachment was added when sending message

Did you try this:

Set insp = Item.GetInspector
insp.Activate

--
Sue Mosher, Outlook MVP
Author of Microsoft Outlook 2007 Programming:
Jumpstart for Power Users and Administrators
http://www.outlookcode.com/article.aspx?id=54


"kkappabear" wrote in message ups.com...
I've got no idea what was wrong, anyway it doesn't worked properly, so
I've wrote a simpler version:

Private Sub Application_ItemSend(ByVal Item As Object, Cancel As
Boolean)

Dim lngres As Long
If Item.Attachments.Count = 0 Then
lngres = MsgBox("No attachments, continue?", _
vbYesNo + vbDefaultButton2 + vbQuestion + vbSystemModal,
"Auto control...")
If lngres = vbNo Then Cancel = True
End If

End Sub

all works fine, but the popup shows in the main outlook window and
once I click to "No" I would like to switch the "New mail" window
back. Is it possible to toggle the new mail window after Cancel=True ?



On 30. Júl, 13:17 h., "Sue Mosher [MVP-Outlook]"
wrote:
Take a look at the sample athttp://www.outlookcode.com/codedetail.aspx?id=553


"kkappabear" wrote in ooglegroups.com...
Hi,
I'm new to VBA and I'm trying to find some relevant links to this
topic. What I'm trying to do is that once user clicks on "send
message" the message will be scanned if it contains any attachments
and if not a popup will show up asking if he wants to add attachment
to the message.
So, what I need to know are informations about adding action to pre-
defined button in outlook, checking if attachment was added and then
regarding the answer on popup send the message or get back to
attachement addition.


Thank you for any help.


Marek Zacik



 




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
Names Added Automatically to Address Book Guv Bob Outlook Express 1 June 9th 07 07:30 PM
how to get emailers automatically added to contacts when I reply actiongr Outlook - Using Contacts 1 January 4th 07 11:04 PM
How do I prevent meeting requests from automatically being added? Matthew Something Outlook - Calandaring 0 October 12th 06 01:09 PM
Sending email with attachment produces error message but email is OW Outlook Express 3 June 24th 06 08:59 PM
Can an automatic message be added when sending encrypted e-mail? Carnitram Outlook and VBA 1 June 7th 06 04:53 PM


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