Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
Password Reminder
Register
| FAQ | Members List | Search | Today's Posts | Mark Forums Read
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Reply
 
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old January 11th, 2013, 12:53 AM
Registered User
Points: 5, Level: 1
Points: 5, Level: 1 Points: 5, Level: 1 Points: 5, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Jan 2013
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default Need code to set up different auto BCC settings for seperate emails

Hello,
I am currently using Outlook 2010 with Visual Basic 7.0 installed. I have multiple emails set up on my profile that I need to have access to for wrk. I am trying to set up each email so that it bcc's itself. For example:
When I send an email from abc@joe.ca, I want the auto bcc to go to abc@joe.ca. When I send an email from xyz@joe.ca, I want an email to automatically be bcc'd to xyz@joe.ca.
This is the basic code I am currently using. Regardless of the email account I send an email from, the bcc is always "abc@joe.ca".

Code:
Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
 
Dim objRecip As Recipient
Dim strMsg As String
Dim res As Integer
Dim strBcc As String
On Error Resume Next

' #### USER OPTIONS ####
' address for Bcc -- must be SMTP address or resolvable
' to a name in the address book
strBcc = "josh@spurrell.ca"

Set objRecip = Item.Recipients.Add(strBcc)
objRecip.Type = olBCC
If Not objRecip.Resolve Then
strMsg = "Could not resolve the Bcc recipient. " & _
"Do you want still to send the message?"
res = MsgBox(strMsg, vbYesNo + vbDefaultButton1, _
"Could Not Resolve Bcc Recipient")
If res = vbNo Then
Cancel = True
End If
End If

Set objRecip = Nothing
End Sub
Is there a way I can manipulate this code or do I need to set up a seperate profile for each of my individual emails?

Help? :-)
Reply With Quote
Reply


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

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto generate get and set methods jdang67 .NET Framework 2.0 10 January 16th, 2008 08:20 AM
objCDO.bCc with multi emails xxsuperfly Classic ASP Databases 1 December 31st, 2006 01:34 PM
Auto Emails From Access SparrowCathy Access 6 April 6th, 2006 08:14 PM
Code to send emails maitias C# 2005 2 February 1st, 2006 01:09 PM
Seperate Code JsonTerre1 BOOK: ASP.NET Website Programming Problem-Design-Solution 1 November 7th, 2004 04:38 PM



All times are GMT -4. The time now is 08:21 AM.


Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.