![]() |
|
|
|
#1
|
||||
|
||||
|
ItemSend works when you send the Item from Outlook. It has already been sent by your application to the Outbox so by-passes the function.
If you don't have Outlook sending messages instantly, it should be possible to re-open each message in the Outbox using a macro add your CC to those requiring it and resend them. e.g. Code:
Option Explicit
Sub AddCC()
Dim oFolder As Folder
Dim olItem As MailItem
Set oFolder = Session.GetDefaultFolder(olFolderOutbox)
For Each olItem In oFolder.Items
If InStr(1, olItem.To, "someone@somewhere.com", vbTextCompare) > 0 Then
olItem.CC = "someoneelse@somewhere.com"
olItem.Send
End If
Next olItem
lbl_Exit:
Set oFolder = Nothing
Set olItem = Nothing
Exit Sub
End Sub
__________________
Graham Mayor - MS MVP (Word) (2002-2019) Visit my web site for more programming tips and ready made processes www.gmayor.com |
|
#2
|
|||
|
|||
|
... but is it really in the Outbox ?
If I click on the [x] then the E:Mail doesn't get sent (although of course, the application could be deleting it from there), and if I click on the Send button I get a message that says "I have successfully created the E:Mail and posted it in your Outbox (but again, this could of course just be the way the application is wording things). Looking around it seems that the Send window is basically just a Form, as it looks like you are able to create your own one to replace it in your own application, so if that is the case then surely there is a way (although if there is it seems pretty well hidden !!!) to do something when that Send button is pressed ?!?BTW, I copied your code into a module & if I press F8 it gives me the option to run it, but when I do (or Step into it) nothing happens
|
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Program-generated .pdf file unable to be opened
|
Errol Isenberg | Word VBA | 3 | 07-13-2015 02:50 PM |
| Pulling Address Generated Word Documents | Aalaf Alot | Word | 1 | 09-06-2012 11:27 PM |
| Re-Arrange Generated Data | flds | Excel | 4 | 06-29-2012 08:17 AM |
| VBA generated e-mail -> Outlook 2003 and permission | dkub | Outlook | 0 | 07-29-2011 07:50 AM |
replace automatically generated page numbers
|
LitWissOnline | Word | 3 | 01-24-2011 03:40 PM |