Message 1 of 6
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello, I've come across a issue with my vb.net code for a custom add-in.
Code below creates a button in one of my ribbon panels, and the CreatePDF sub is partly working with this button.
Public Sub BtnPDFCreate_OnExecute(Context As NameValueMap) Handles BtnPDFCreate.OnExecute
Dim Myform As New PDF
Myform.CreatePDF()
End Sub
When I press the button from the ribbon, the "PDF Created" messagebox shows, and it should continue to the "if lines()", but it skips that for some reason. If I add a messagebox between the "if lines()", these messageboxes shows up.
Public Sub CreatePDF()
'hidden interesting code to create a PDF
MsgBox("PDF Created!")
Dim Lines() As String = IO.File.ReadAllLines("C:\TEMP\Personal options.txt")
' Personal options
'Msgbox("Test 1")
If Lines(4) = "True" Then Button10.PerformClick()
'Msgbox("Test 2")
If Lines(5) = "True" Then Button9.PerformClick()
'Msgbox("Test 3")
End Sub
I've tried to use Call Button.10.PerformClick(), but this did nothing.
However, if I run the code with a button within the PDF form, everything works perfectly.
Solved! Go to Solution.