I am on working several integrated Excel and Outlook projects for my own use at work. I want a button on a custom task pane to do something. I can not figure out how to call a procedure in Excel or Outlook.
I am using VSTO 2019 and Office 2016 and am using VBA. I have the following callback in the UserControl1.vb
Private Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Button1.Text = "ok"
End Sub
I can do anything I want to the CTP from the addin or usercontrol code, but I can not figure out how to call a procedure in the app the addin is installed in (Outlook or Excel). The debugger rejects the procedure as undeclared. And, I can't figure out how to reference a control from Outlook VBA. It does not recognize the usercontrol or the control (they are not in the object browser, also). I did try pasting this callback into ThisWorkbook/ThisOutlookSession and into a module (after removing "Handles Button1.Click" which threw an error) but it never ran when the button was clicked.
I feel like I need to make an event handler for the button, but don't know how and couldn't find any examples. If I can just get some example VBA code I can plagiarize, I am sure I can figure out the rest.
Bookmarks