I am trying to change the default Outlook account from VFP via automation but it seems to be readonly for new mail messages... Does somebody know the solution?
oOutlook = CREATEOBJECT("Outlook.Appl
oNamespace = oOutlook.GetNameSpace("MAP
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)
loItem.Send() && sends the message to default account address
*-- 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?
Subquestion is: Does it work same (wrong) way for you in VFP?
Similar code executed from VB.NET works correctly... (see e.g. http://msdn.microsoft.com/en-us/library/bb207787.aspx
Thanks for all responses