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