1 Reply Latest reply on Aug 31, 2016 12:45 AM by rkoonce

    I would like to create a button within the process book display that opens IE and uses a value from a pi tag in the url.

    lagerme

      I am looking to create a button that open IE and a web page that utilizes a value from a Tag within PI.

       

      For example the following would be the webpage I would like to open:

       

      "http://server/HOOPS/Apps/Utilities/DisplayAlarms/UI/DisplayAlarms.aspx?order=" Tag1 "&batch=" Tag1 "&unit=Proc&load=999" & "&prod="Tag2"

       

      Where Tag1 = 12345 and Tag2 = ABCD in Pi giving you a final URL of

       

      http://server/HOOPS/Apps/Utilities/DisplayAlarms/UI/DisplayAlarms.aspx?order=12345&batch=12345&unit=Proc&load=999&prod=ABCD

       

       

      Can this be done?

        • Re: I would like to create a button within the process book display that opens IE and uses a value from a pi tag in the url.
          rkoonce

          Hello Malcolm,

           

          One method would be to insert an activeX command button (toolbar "hammer/ wrench", scroll to microsoft forms 2.0 commandbutton).

          Then go to the VB editor and put this code under  the click event for the button (mine was commandbutton4):

           

          Private Sub CommandButton4_Click()
          
          
          Dim retVal As Long
          Dim strURL As String
          Dim strBatch As String
          Dim vrDate As Variant
          Dim vrStatus As Variant
          
          
          strURL = "http://www.google.com/#q="
          strBatch = "robots"                            ' if using hardcoded text'
          strBatch = Me.Text1.Contents                    ' if using text symbol'
          strBatch = Value1.GetValue(vrDate, vrStatus)   ' if using value symbol'
          
          
          strURL = strURL & strBatch
          retVal = Shell("C:\Program Files\Internet Explorer\iexplore.exe " & strURL, vbNormalNoFocus)
          
          
          ' retVal returns a handle to the browser window - it can be used for Sendkeys '
          End Sub
          

           

          Cheers!

          Richard

          3 of 3 people found this helpful