I'm copying the code below from an old Blog, but it describes the issue exactly. Setting loItem.SendUsingAccount was working fine until recently. Most likely a recent update to Outlook 365 or 2016 seems to have broke it. Is anyone else able to set loItem.SendUsingAccount property successfully, as in the following example? Or does anyone have a solution to make it work? TIA!
oOutlook = CREATEOBJECT("Outlook.Application")
oNamespace = oOutlook.GetNameSpace("MAPI")
oNamespace.Logon()
loItem = oOutlook.CreateItem(0)
loitem.To = '***@email.com'
loitem.Body = "BODY"
loitem.SendUsingAccount = oOutlook.Session.Accounts.Item[2]
this is valid POP3 account
? loitem.SendUsingAccount
loitem.Display
means the SendUsingAccount property is no more Readonly and I can assign
different accounts via automation commands...
So, the question is: How to create mail item having the SendUsingAccount
property R/W using automation in VFP?
Similar code works fine in VB.NET, so it seems to be purely VFP - Outlook
interoperability problem.