I am trying to change the default Outlook account but it seems to be readonly for new mail messages... Does somebody know the solution?
My code (Visual FoxPro):
oOutlook = CREATE("Outlook.Application")
oNamespace = oOutlook.GetNameSpace("MAPI")
loItem = oOutlook.CreateItem(0)
loitem.To = 'email@example.com'
loitem.Body = "BODY"
*-- Here is the problem
loitem.SendUsingAccount = oOutlook.Session.Accounts.Item && I am sure this is POP3 account
*-- Account should be changed now BUT
? loitem.SendUsingAccount && Still returns null (it is not an object)
*-- After issuing
*-- and changing Account manually via UI everything works as it should - 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?
Outlook version: 2007 SP2 (12.0.6514.5000)
OS version: Vista SP2
VB.NET zone added to meet more experts.