none
SentOnBehalfOfName usage in code doesn't work very well.. Outlook 2010, vb.net RRS feed

  • Question

  • Hello,

    I was asked to make some small code that by default changes the "SentOnBehalfOfName" when a new email is created.

    It actually works, using following code:

    Dim mailitem As Outlook.MailItem = TryCast(Inspector.Currentitem, Outlook.MailItem)

    If Not (mailitem Is Nothing) Then

           If mailitem.EntryID Is Nothing Then

                   mailitem.SentOnBehalfOfName = ict@...  

         End If

    End If

    Above works fine, but my problem is following:

    Outlook is started and this Add-In is loaded (it is an addin created in .NET, as more needs to be done in the future with it)

    When creating a first new email message, it actually shows the From field as ict@..., and I can send the message as that other email address.

    But, when a second email is made it doesn't show on-screen that this field is changed.

    However it does send it as the entered value in the code.

    Is there any way to make sure it Always shows the FROM field as it should?

    Thanks,

    Thursday, August 22, 2013 7:47 AM