From: SDS2 on 9 May 2010 11:38 Hey, I was wondering if i could create a program in Visual Studio 2008 with a link to an executable of an application (like MS WORD) in it. By pressing a button, the executable of the application should start. I can't manage to find out the right code to do so. Can anyone help me out? Thanks in advance. Stan
From: Family Tree Mike on 9 May 2010 11:55 On 5/9/2010 11:38 AM, SDS2 wrote: > Hey, > > I was wondering if i could create a program in Visual Studio 2008 with a > link to an executable of an application (like MS WORD) in it. > > By pressing a button, the executable of the application should start. > > I can't manage to find out the right code to do so. > > > Can anyone help me out? > > > > Thanks in advance. > > Stan Look at System.Diagnostics.Process.Start("some path to an exe"); -- Mike
From: Patrick A on 10 May 2010 18:24 Stan, Do you want to open a file while you're at it? Here's what I'm doing...not sure it's the best method. Imports Microsoft.Office.Interop Private Sub ReportsToolStripMenuItem_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles ReportsToolStripMenuItem.Click Dim MyAccess As Access.Application MyAccess = GetObject("P:\Production Resources\Legal55\Reports \Timekeeper Reports.mdb", "Access.Application") MyAccess.Visible = True End Sub Patrick
From: Family Tree Mike on 10 May 2010 18:47 On 5/10/2010 6:24 PM, Patrick A wrote: > Stan, > > Do you want to open a file while you're at it? > > Here's what I'm doing...not sure it's the best method. > > Imports Microsoft.Office.Interop > > Private Sub ReportsToolStripMenuItem_Click(ByVal sender As > System.Object, ByVal e As System.EventArgs) Handles > ReportsToolStripMenuItem.Click > Dim MyAccess As Access.Application > MyAccess = GetObject("P:\Production Resources\Legal55\Reports > \Timekeeper Reports.mdb", "Access.Application") > MyAccess.Visible = True > End Sub > > Patrick If you just want to launch access (or word) with a given file, then you should use: dim p as new Process() p.StartInfo.FileName = "somefilename.mdb" ' or "somefilename.doc" p.StartInfo.Verb = "Open" p.Start() -- Mike
From: SDS2 on 11 May 2010 14:54 Isn't there a method that is able to open any path? (an application?) "Family Tree Mike" <FamilyTreeMike(a)ThisOldHouse.com> schreef in bericht news:uBgZ3KJ8KHA.3880(a)TK2MSFTNGP04.phx.gbl... > On 5/10/2010 6:24 PM, Patrick A wrote: >> Stan, >> >> Do you want to open a file while you're at it? >> >> Here's what I'm doing...not sure it's the best method. >> >> Imports Microsoft.Office.Interop >> >> Private Sub ReportsToolStripMenuItem_Click(ByVal sender As >> System.Object, ByVal e As System.EventArgs) Handles >> ReportsToolStripMenuItem.Click >> Dim MyAccess As Access.Application >> MyAccess = GetObject("P:\Production Resources\Legal55\Reports >> \Timekeeper Reports.mdb", "Access.Application") >> MyAccess.Visible = True >> End Sub >> >> Patrick > > If you just want to launch access (or word) with a given file, then you > should use: > > dim p as new Process() > p.StartInfo.FileName = "somefilename.mdb" ' or "somefilename.doc" > p.StartInfo.Verb = "Open" > p.Start() > > -- > Mike
|
Next
|
Last
Pages: 1 2 Prev: Update - Microsoft Responds to the Evolution of Community Next: Multiple configurations |