Microsoft Office Forums How do I add a CC to an externally generated Email ?

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 01-22-2016, 02:59 PM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows Vista How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Thumbs up How do I add a CC to an externally generated Email ?

I run an application that creates an E:Mail, but I need to add a CC recipient before it actually sends ... it does tell me it's going to send, as per the attached picture ...



I created a Rule to add a CC but it doesn't seem to work under this example and I NEED this CC on the E:Mail ...

Can somebody please give me an example of VBA that will grab this E:Mail as soon as I click SEND and add a CC Recipient BEFORE it actually actions the Send ?!?

Many thanks if you can help
Attached Images
File Type: jpg ScreenHunter_04 Jan. 22 21.51.jpg (26.8 KB, 5 views)
Reply With Quote
  #2  
Old 01-22-2016, 10:46 PM
gmayor's Avatar
gmayor gmayor is online now How do I add a CC to an externally generated Email ? Windows 10 How do I add a CC to an externally generated Email ? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,906
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

I am happy to be contradicted, but I don't think this is possible from a third party application. It would have to be done in that application.

Will the application take two addresses separated by a semi-colon?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #3  
Old 01-23-2016, 03:22 AM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows Vista How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Default

... I hope you are wrong gmayor

I can't make the Application do anything other than it already does, unfortunately, there is no option for me to make it add a second address, either in the TO or CC fields ...the page is there for me to add a CC physically if I want to, I would just rather it be done automatically as I know I will forget to add it as many times as I remember !!!

I have found this (http://www.translatorscafe.com/cafe/...e=flat&submit=) which insinuates I should be able to do what I want, but I have added it and followed the instructions and put a STOP in the code, but it doesn't seem to get processed
Reply With Quote
  #4  
Old 01-23-2016, 03:33 AM
gmayor's Avatar
gmayor gmayor is online now How do I add a CC to an externally generated Email ? Windows 10 How do I add a CC to an externally generated Email ? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,906
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

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
Reply With Quote
  #5  
Old 01-23-2016, 07:02 AM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows 7 64bit How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Default

... 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
Reply With Quote
  #6  
Old 01-23-2016, 07:21 AM
gmayor's Avatar
gmayor gmayor is online now How do I add a CC to an externally generated Email ? Windows 10 How do I add a CC to an externally generated Email ? Office 2016
Expert
 
Join Date: Aug 2014
Posts: 2,906
gmayor is just really nicegmayor is just really nicegmayor is just really nicegmayor is just really nice
Default

If Outlook is your default e-mail application then Outlook is used to send e-mail, unless your application has its own custom e-mail function, in which case Outlook would not be involved.

You can check by switching Outlook not to send messages immediately, then send a message from your application. Does the message appear in Outbox?

Ads for the macro, did you change the two e-mail addresses to reflect what it is you are trying to do? Were there messages in the Outbox that reflected what you were trying to modify?
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
  #7  
Old 01-23-2016, 07:49 AM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows 7 64bit How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Default

I've just discovered something ... if I create a new E:Mail and click Send, the code cuts in and intercepts the E:Mail. However, if it is the E:Mail created by the Application and I click on the Send button, the code doesn't cut in ... why would this be ?!?!?
Reply With Quote
  #8  
Old 01-26-2016, 12:49 PM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows 7 64bit How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
If Outlook is your default e-mail application then Outlook is used to send e-mail, unless your application has its own custom e-mail function, in which case Outlook would not be involved.

You can check by switching Outlook not to send messages immediately, then send a message from your application. Does the message appear in Outbox?

Ads for the macro, did you change the two e-mail addresses to reflect what it is you are trying to do? Were there messages in the Outbox that reflected what you were trying to modify?
I spoke to the man who wrote the application and as you originally suspected, the app uses MAPI protocol and therefore the VBA processes are bypassed

That appears to be the case for Macros as well ...

Thanks for your help though and I am now trying to find another way !!!
Reply With Quote
  #9  
Old 01-26-2016, 02:50 PM
vodkasoda vodkasoda is offline How do I add a CC to an externally generated Email ? Windows 7 64bit How do I add a CC to an externally generated Email ? Office 2007
Novice
How do I add a CC to an externally generated Email ?
 
Join Date: Apr 2013
Location: Stowmarket, Suffolk, UK
Posts: 15
vodkasoda is on a distinguished road
Default

Quote:
Originally Posted by gmayor View Post
I am happy to be contradicted, but I don't think this is possible from a third party application. It would have to be done in that application.

Will the application take two addresses separated by a semi-colon?
As the Application uses MAPI Protocol to send the message, VBA is bypassed, so yes, spot on gmayor
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How do I add a CC to an externally generated Email ? 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
How do I add a CC to an externally generated Email ? replace automatically generated page numbers LitWissOnline Word 3 01-24-2011 03:40 PM


All times are GMT -7. The time now is 10:06 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2019, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2019 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft