Maybe you should start by explaining what you want to do.
Here's a command I wrote that uses the FileDialogs. It imports save views from a template into the current dwg.
Code:
Public Sub ImportViews()
On Error GoTo ErrHandler:
Dim strAppPath As String
Dim objFile As FileDialogs
Dim strFilter As String
Dim strFileName As String
Dim strTempName As String
Dim fso As Scripting.FileSystemObject
Dim fsoFile As Scripting.file
Dim objView As AcadView
Dim dbxdoc As Object 'AxDbDocument
Dim colSelected As Collection
Set fso = CreateObject("Scripting.FileSystemObject")
strAppPath = ThisDrawing.Application.Preferences.Files.TemplateDwgPath
Set objFile = New FileDialogs
'desc,filter combinations must all be separated with pipe char "|"
strFilter = "Templates (*.dwt)|*.dwt|Drawings (*.dwg)|*.dwg"
objFile.OwnerHwnd = ThisDrawing.hWnd 'bind the dialog to the window
objFile.Title = "Select file to views from."
objFile.StartInDir = strAppPath
objFile.Filter = strFilter
'return a valid filename
GetFile:
strFileName = objFile.ShowOpen
If Not strFileName = vbNullString Then
'check for dwt, ObjectDbx can only open dwg's
If fso.GetExtensionName(strFileName) = "dwt" Then
'copy template to temp folder as dwg
strTempName = ThisDrawing.Application.Preferences.Files.TempFilePath & fso.GetBaseName(strFileName) & ".dwg"
fso.CopyFile strFileName, strTempName, True
strFileName = strTempName
End If
'use ObjectDbx to get page setups in the background
'open dbxdoc
Set dbxdoc = AcadApplication.GetInterfaceObject("ObjectDBX.AxDbDocument")
dbxdoc.Open strFileName
'get a list of plot configs to import
Set frmImportViews.Views = dbxdoc.Views
frmImportViews.FillLists
frmImportViews.Show
Set colSelected = frmImportViews.SelectedViews
If colSelected.Count = 0 Then Exit Sub
Unload frmImportViews
'copy the views from the template
For Each objView In colSelected
ThisDrawing.Views.Add objView.Name
Next objView
Set dbxdoc = Nothing
'delete temp file if exists
If Not strTempName = vbNullString Then fso.DeleteFile strTempName
Else 'user clicked cancel in file dialog
End If
Set objFile = Nothing
Set fso = Nothing
Exit Sub
ErrHandler:
Select Case Err.Number
Case Is = 70, Is = -2147467259
MsgBox Err.Number & " - " & Err.Description & vbCrLf & "File may be in use or read-only.", vbCritical, "Import Views"
GoTo GetFile
Case Else
MsgBox Err.Number & " - " & Err.Description, vbCritical, "Import Views"
End Select
End Sub