this sample project backup sample.zip (created with zenon 6.22 SP0) shows how to open a .pdf file (in the acrobat reader) or a .jpg file in the HTML window, depending on the value of a variable.
Opening the acrobat reader (function "start program") or showing the HTML window with a .jpg file as a graphic (function "picture switch") is done by VBA. Prior to executing the function, the function parameter is changed according to the value of the variable "Article".
This allows for adding new .jpg / .pdf files to be opened in the runtime, without the need to make any modifications to the project in the editor.