How can I get my app to open AutoCAD and then open the file that i have selected?
Imports System
Imports System.IO
Public Class Form1
Dim PathAcad As String = "C:\Program Files\AutoCAD Map 3D 2010\acad.exe"
Dim DwgFile As String
Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
End Sub
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
OpenFileDialog1.Filter = "Drawing File(*.dwg)|*.dwg"
OpenFileDialog1.FileName = ""
OpenFileDialog1.ShowDialog()
DwgFile = OpenFileDialog1.FileName
If IO.File.Exists(PathAcad) = True Then
Dim p As New Diagnostics.Process
p.StartInfo.FileName = PathAcad
p.Start()
End If
End Sub
Private Sub Button2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button2.Click
Me.Close()
End Sub
End Class
Thanks for any help!