• 0

InfoPath and VB code assistance


Question

Hello fellow Neowinians in the programming section.

 

I am creating an InfoPath 2010 form for use at my work and am needing a bit of assistance.

 

I am trying to create a button that when clicked opens a specific file. I am pretty sure I need to add some VB code to the button to achieve this but I have never messed with Visual Basic before.

Link to comment
Share on other sites

5 answers to this question

Recommended Posts

  • 0

If the file is an executable (.exe), attach the following code to the OnClick event of the button:

 

Private Sub cmdCalculator_Click()
    Dim RetVal
    RetVal = Shell("CALC.EXE", 1)     ' Run Windows Calculator.
End Sub

 

Link to comment
Share on other sites

  • 0

in this case I'm actually just trying to open another infopath form. would that be possible with similar code?

 

Here's a bit of the backstory. Where I work they have a hook in our notation program to an infopath form that acts as our quick notes utility (click the button of the procedure and it posts the notes). We also have a few other forms we use for ticket submission to certain email groups. I am one of the people that has access to update and maintain the main quick notes infopath form, what I'd like to do is add a couple of buttons within the quick notes form to open our secondary forms.

Link to comment
Share on other sites

  • 0

I do not have any experience with Infopath. However, I believe similar code will work.

 

Is the notation program on the same workstation as the Infopath form? I ask because if it isn't, the code will have to be amended to deal with a UNC file path.

 

I will look into it and see what I can do.

 

Edit: I am not receiving forum notifications, so I have to manually check my posts for responses.

Edited by Ice_Blue
Link to comment
Share on other sites

  • 0

the notation program as well as the infopath forms are located on a network drive but the drive is assigned the same letter for everyone so I don't believe that portion should be an issue

Link to comment
Share on other sites

This topic is now closed to further replies.
  • Recently Browsing   0 members

    • No registered users viewing this page.