Change sender name outlook vba 2010 Custom Userform

Status
Not open for further replies.

DAVID POWELL

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
I have a snippet code to send a "Custom Form"(Organization Forms Library).
I want to change the "From" to NOT display my name but something like "Sales Support".


I cant use "sendonbehalfof"- read only property
I cant use a delegate.

Really limited on what to do ?

Dim strForm As String
Dim objFolder As Folder
Dim objItem As Outlook.MailItem
'Dim objRecip As Recipient
Dim strBcc As String
Dim objMail As Outlook.MailItem
Dim objRecip As Outlook.Recipient

'strBcc = "xxxx@xxxger.com"


strForm = "IPM.Note.proposalm"
Set objFolder = _
Application.ActiveExplorer.CurrentFolder
Set objItem = _
objFolder.Items.Add(strForm)
objItem.To = "xxxxxx@xxxxxger.com"
Set objRecip = objItem.Recipients.Add(strBcc)
objRecip.Resolve
If objRecip.Resolved Then
objRecip.Type = olBCC ' 3
End If
objItem.Subject = "Proposal Survey. Please Respond."
objItem.Send
' objItem.Display
Item_Open = True

Thanks
David
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
The only way to change the display name if you can't change on the account is by using SMTP to send it. You'd need to add your account as POP3 (use a fake incoming server name, like mail, and set it to not receive mail in send & receive settings) then send it from that account.
Use the account name (usually the email address) as it is shown in Account Settings or the folder list in place of smtp@account

Code:
Dim oAccount As Outlook.Account
For Each oAccount In Application.Session.Accounts
      If oAccount.DisplayName = "smtp@account" Then
          objMsg.SendUsingAccount = oAccount
     End If
Next
 
Status
Not open for further replies.
Top