What's the equivalent in C# of this VB code on an Outlook form?
- by wes
Basically, how do I link an Outlook form and a C# back end? In VB you can write on the form
Sub ButtonName_Click()
Dim Recipients
With Item.GetInspector.ModifiedFormPages("Message")
Set Recipients = .Controls("To")
End With
End Sub
which will fire whenever the button named "ButtonName" on the form is clicked and will set the variable Recipients to a string of whatever is in the To text box.
Now I have a custom form, and I have a VS C# Outlook Add-in, and they're two separate things. I've got an event handler that can catch MailItem objects, but I don't know how to handle custom form button clicks or even how to access elements on the form.
EDIT - Just to clarify, the custom form was created in Outlook and then its .ofs was imported into VS. Both Outlook and VS are 2010.