Outlook Dilimena

bjurney

Active Member
Joined
Aug 24, 2009
Messages
320
I am using an adaptation of the code below which sends an e-mail in Outlook 2003 using Excel 2003. In Outlook I use my personal company e-mail and a group e-mail for our department. When I want to send an e-mail through outlook I create a new e-mail and send, but when I want to send the e-mail through my group inbox, I have to type the name of my department in the from field to say its from the department and not from me. I want to have that field autopopulate but cant seem to figure out a way to do it. i tried using .from = "Department Name" in the With section to no avail. Any suggestions would be much appreciated


Code:
 Sub eMailActiveWorksheet()
Dim OL As Object
Dim EmailItem As Object
Dim subj As String
 
 
subj = "A subject "
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
 
With EmailItem
.Subject = subj
.Body = "words"
.To = Range("F46").Value
.CC = Range("F47").Value
.BCC = "[EMAIL="xyz@123.com"]xyz@123.com[/EMAIL]"
.Importance = olImportanceNormal 'Or olImprotanceHigh Or olImprotanceLow
.display
End With
 
Set Wb = Nothing
Set OL = Nothing
Set EmailItem = Nothing
End Sub
 

Excel Facts

How to calculate loan payments in Excel?
Use the PMT function: =PMT(5%/12,60,-25000) is for a $25,000 loan, 5% annual interest, 60 month loan.
Not sure if this will do it for you but no harm in trying it.
It adds a 'From' field with 'Department Name' in

Code:
.SentOnBehalfOfName = "Department Name"
 
Last edited:
Upvote 0
Perfect, I wasnt sure of the context of it and tried searching for it, but nothing came up. Thanks for the help!
 
Upvote 0

Forum statistics

Threads
1,225,149
Messages
6,183,194
Members
453,151
Latest member
Lizamaison

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top