how to create link in visual basic that will connect button with specified program???

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • duudii
    New Member
    • Jan 2007
    • 5

    how to create link in visual basic that will connect button with specified program???

    I want to make a small simple program which will show few buttons, when each of tem is being clicked then automaticly user gets to appropriate software with specified path for example when I press button autocad it opens autocad which is in C:/autocad/autocad.exe when I want to open dura.apr lotus application which is in c:/dura/dura.apr it is being open after clicking on dura button when I click on sales folder it automaticly goes to sales folder which is in c:/sales/sales files/sales folder etc. It is easy to do it in excel, just using hyperlinks and it works fine, but I want to make it in vb so when I execute exe file I have menu with all buttons (autocad, dura, sales folder etc) the software stays on where other aplications are opened and it should also have exit button which closes it. can anyone help me, I have spend lots of time and I can only find how to open website linked to button. I am begginer in vb so please writte full code.
    many thanx
    Dudi
  • hariharanmca
    Top Contributor
    • Dec 2006
    • 1977

    #2
    Originally posted by duudii
    I want to make a small simple program which will show few buttons, when each of tem is being clicked then automaticly user gets to appropriate software with specified path for example when I press button autocad it opens autocad which is in C:/autocad/autocad.exe when I want to open dura.apr lotus application which is in c:/dura/dura.apr it is being open after clicking on dura button when I click on sales folder it automaticly goes to sales folder which is in c:/sales/sales files/sales folder etc. It is easy to do it in excel, just using hyperlinks and it works fine, but I want to make it in vb so when I execute exe file I have menu with all buttons (autocad, dura, sales folder etc) the software stays on where other aplications are opened and it should also have exit button which closes it. can anyone help me, I have spend lots of time and I can only find how to open website linked to button. I am begginer in vb so please writte full code.
    many thanx
    Dudi



    Use shell(<StringAp plicationPath>, <Focus Mode>)

    Comment

    • willakawill
      Top Contributor
      • Oct 2006
      • 1646

      #3
      Originally posted by duudii
      I want to make a small simple program which will show few buttons, when each of tem is being clicked then automaticly user gets to appropriate software with specified path for example when I press button autocad it opens autocad which is in C:/autocad/autocad.exe when I want to open dura.apr lotus application which is in c:/dura/dura.apr it is being open after clicking on dura button when I click on sales folder it automaticly goes to sales folder which is in c:/sales/sales files/sales folder etc. It is easy to do it in excel, just using hyperlinks and it works fine, but I want to make it in vb so when I execute exe file I have menu with all buttons (autocad, dura, sales folder etc) the software stays on where other aplications are opened and it should also have exit button which closes it. can anyone help me, I have spend lots of time and I can only find how to open website linked to button. I am begginer in vb so please writte full code.
      many thanx
      Dudi
      Hi Dudi
      You can find the code here

      Comment

      • duudii
        New Member
        • Jan 2007
        • 5

        #4
        Originally posted by willakawill
        Hi Dudi
        You can find the code here
        Hi again
        I still dont know how to do it :((

        I made a button and I have such code

        Public Class Form1

        Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

        End Sub
        End Class

        what should I do with this to have opened autocad which is in C:\autocad\auto cad.exe when I click on the button. I know this is simple but still I cannot see solution :(( If I know how to do one I will manage to link other software.
        many thanx for help

        Comment

        • hariharanmca
          Top Contributor
          • Dec 2006
          • 1977

          #5
          Originally posted by duudii
          Hi again
          I still dont know how to do it :((

          I made a button and I have such code

          Public Class Form1

          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

          End Sub
          End Class

          what should I do with this to have opened autocad which is in C:\autocad\auto cad.exe when I click on the button. I know this is simple but still I cannot see solution :(( If I know how to do one I will manage to link other software.
          many thanx for help


          Public Class Form1

          Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click
          shell("C:\autoc ad\autocad.exe ",vbMaximizedFo cus)
          End Sub
          End Class

          Comment

          • hariharanmca
            Top Contributor
            • Dec 2006
            • 1977

            #6
            Originally posted by duudii
            Hi again
            I still dont know how to do it :((

            I made a button and I have such code

            Public Class Form1

            Private Sub Button1_Click(B yVal sender As System.Object, ByVal e As System.EventArg s) Handles Button1.Click

            End Sub
            End Class

            what should I do with this to have opened autocad which is in C:\autocad\auto cad.exe when I click on the button. I know this is simple but still I cannot see solution :(( If I know how to do one I will manage to link other software.
            many thanx for help

            Shell will open Exe format Files through VB coding.... Ok

            Comment

            • duudii
              New Member
              • Jan 2007
              • 5

              #7
              Originally posted by hariharanmca
              Shell will open Exe format Files through VB coding.... Ok
              Ok, it works with exe files, but when I have assigned dura.apr lotus approach it doesnt work, or when I have assigned specified .doc file or draving and photo (I need all that there) I hink that I need some kind of recognision of file type and appropriate software. I cannot assign folder as well like in hyperlink in excel (when you specify path Y:\Sales Files\Quotes Masters then it (excel) opens this folder, I want to do the same in visual basic)
              One more thing, I have forgotten how to compile visual basic file into .exe file, I have new visual basic 2005 express edition, hould I select it somehow at the begining? I was using vb 3 years ago and I have forgotten everything :(
              many thanx for all your help.

              Comment

              • hariharanmca
                Top Contributor
                • Dec 2006
                • 1977

                #8
                Originally posted by duudii
                Ok, it works with exe files, but when I have assigned dura.apr lotus approach it doesnt work, or when I have assigned specified .doc file or draving and photo (I need all that there) I hink that I need some kind of recognision of file type and appropriate software. I cannot assign folder as well like in hyperlink in excel (when you specify path Y:\Sales Files\Quotes Masters then it (excel) opens this folder, I want to do the same in visual basic)
                One more thing, I have forgotten how to compile visual basic file into .exe file, I have new visual basic 2005 express edition, hould I select it somehow at the begining? I was using vb 3 years ago and I have forgotten everything :(
                many thanx for all your help.

                You want Make EXE of VB6 or VB2005

                Comment

                • duudii
                  New Member
                  • Jan 2007
                  • 5

                  #9
                  Originally posted by hariharanmca
                  You want Make EXE of VB6 or VB2005
                  I want to make an exe file in visual basic,kind of linking software. When I will click on it I will have a window with several buttons. When I will click on button autocad then I will go to autocad.exe, but still the program will be running so If I want to go to lotus approach file then I just click approach button, when I want to go to sales folder I just click on sales folder button and additionally an exit button to finish and close this vb application. I did it all in excel and it works as hyperlinks perfectly, but I want to have it in window with nice buttons that is why I choosen visual basic. It was so easy to do those hyperlinks in excel, so I expected that I will just draw button click on it and write path in visual basic. I hope you can understand now better and help me.
                  cheers

                  Comment

                  • hariharanmca
                    Top Contributor
                    • Dec 2006
                    • 1977

                    #10
                    Originally posted by duudii
                    I want to make an exe file in visual basic,kind of linking software. When I will click on it I will have a window with several buttons. When I will click on button autocad then I will go to autocad.exe, but still the program will be running so If I want to go to lotus approach file then I just click approach button, when I want to go to sales folder I just click on sales folder button and additionally an exit button to finish and close this vb application. I did it all in excel and it works as hyperlinks perfectly, but I want to have it in window with nice buttons that is why I choosen visual basic. It was so easy to do those hyperlinks in excel, so I expected that I will just draw button click on it and write path in visual basic. I hope you can understand now better and help me.
                    cheers
                    in Shell you can Open Exe format files only and if you want to open other file format like word or Exel etc.,., you have to bind .dll files to open through VB.

                    Comment

                    • duudii
                      New Member
                      • Jan 2007
                      • 5

                      #11
                      Originally posted by hariharanmca
                      in Shell you can Open Exe format files only and if you want to open other file format like word or Exel etc.,., you have to bind .dll files to open through VB.
                      can you please send me a sample code how to bind this dll file?

                      Comment

                      • hariharanmca
                        Top Contributor
                        • Dec 2006
                        • 1977

                        #12
                        Originally posted by duudii
                        can you please send me a sample code how to bind this dll file?
                        VB :

                        Just go to menu > project > references

                        then a dialog window will Open then choose the reference file you are goin to use..
                        if its not there then click the Browse... Button near by the list and select the dll file you are going to use.

                        for Ex;
                        Excel application :

                        check : Microsoft excel 11.0 Object library

                        and use the following code


                        =============== === Code =============== ============
                        Dim objExcel As New Excel.Applicati on
                        Dim objWorkBooks As Object

                        Set objWorkBooks = objExcel.Workbo oks
                        objWorkBooks.Op en App.path & "\export.cs v", , , 2, , , , , ","

                        Comment

                        • willakawill
                          Top Contributor
                          • Oct 2006
                          • 1646

                          #13
                          Originally posted by duudii
                          can you please send me a sample code how to bind this dll file?
                          If you are looking to open up particular documents for particular apps (I think this is what you are asking) you can append the document to the app string in Shell,

                          Code:
                          Shell "C:\Program Files\Microsoft Office\Office\Winword.exe C:\MyData\MyWordDoc.doc", vbMaximizedFocus

                          Comment

                          Working...