- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
HI ,
I got a problem to open a dxf file. If I use command method then I can easily do that. But I want to open that file by clicking a button from my windows form. I did the coding for that specified button like below:
Private Sub Button6_Click(sender As System.Object, e As System.EventArgs) Handles Button6.Click
Dim strFileName AsString
LoadDXF.InitialDirectory = "C:\"
LoadDXF.Title = "Open DXF File"
LoadDXF.Filter = "DXF Files|*.dxf"
LoadDXF.ShowDialog()
strFileName = LoadDXF.FileName
Dim acDocMgr AsDocumentCollection = Application.DocumentManager
If (File.Exists(strFileName)) Then
acDocMgr.Open(strFileName, False)
Else
acDocMgr.MdiActiveDocument.Editor.WriteMessage( "File" & strFileName & "does not exist.")
EndIf
EndSub
After invoke that button I got a error like below:
I have searched to solve this problem in the forum. But did not get any productive answer. Can anybody help me in this regards. How can I open the drawing without commandFlags.session? I want to use the button of my form to open that dxf file. Please give me a details hints because I am pretty new in programming.
Thanks in advance.
Zakir
Solved! Go to Solution.