/ Forums / Advansys Formativ / Creating Solutions with Formativ / EmailAddress from ProxyAccount / Reply To: EmailAddress from ProxyAccount
March 2, 2004 at 3:54 pm
#6920
The object GroupWise.Account refers to the root account (the logged-in user), regardless of whether proxying to another account.
To obtain a reference to the proxy account object, use either the Application object from the GroupWise Object API, documented here, or the ClientState object. The following code examples show how to do this with Formativ.
' This example assumes the collection .ProxyAccounts contains exactly one item, ' and that GroupWise has been *programmatically* proxied to only one account. Sub Main(Client, GWEvent) Dim x, y Dim oAccount Dim oMsg ' Programmatically proxy to another account: 'set oAccount = MultiLogin(...) GroupWise.NewMail Set oMsg = GroupWise.ComposingItem x = oMsg.sender Set oAccount = GroupWise.Session.ProxyAccounts.Item(1) y = oAccount.Owner.EmailAddress msgbox "Sender: " & x & ", EmailAddress: " & y Set oMsg = nothing Set oAccount = nothing End Sub
' Client.ClientState.CurrentAccount gives you an instance of the account that was ' proxied to using the GroupWise UI. The email address of the proxied account ' can be accessed thus: Begin Sub Main(Client, GWEvent) MsgBox Client.ClientState.CurrentAccount.Owner.EmailAddress End Sub
I hope this helps.
Advansys Support