randy,
it's not really beautiful, but should work:
Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(p1,
userform1.Label1.Caption, 1#, 1#, 1#,
- alfred -
In article <3DFBF781A292C3D41B5EB4872169CD08@in.WebX.maYIadrTaRb>,
RBILLINGS@PREFERREDMFG.COM says...
> The folling code is from userform1 (I kinda want to by pass this form and go
> straight to the open file box)
>
> Option Explicit
>
> Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias
> "GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long
>
>
> Private Type OPENFILENAME
> lStructSize As Long
> hwndOwner As Long
> hInstance As Long
> lpstrFilter As String
> lpstrCustomFilter As String
> nMaxCustFilter As Long
> nFilterIndex As Long
> lpstrFile As String
> nMaxFile As Long
> lpstrFileTitle As String
> nMaxFileTitle As Long
> lpstrInitialDir As String
> lpstrTitle As String
> flags As Long
> nFileOffset As Integer
> nFileExtension As Integer
> lpstrDefExt As String
> lCustData As Long
> lpfnHook As Long
> lpTemplateName As String
> End Type
>
> Public Function ShowOpen(Filter As String, _
> InitialDir As String, _
> DialogTitle As String) As String
>
> Dim OFName As OPENFILENAME
>
> 'Set the structure size
> OFName.lStructSize = Len(OFName)
> 'Set the owner window
> OFName.hwndOwner = 0
> 'Set the filter
> OFName.lpstrFilter = Filter
> 'Set the maximum number of chars
> OFName.nMaxFile = 255
> 'Create a buffer
> OFName.lpstrFile = Space(254)
> 'Create a buffer
> OFName.lpstrFileTitle = Space$(254)
> 'Set the maximum number of chars
> OFName.nMaxFileTitle = 255
> 'Set the initial directory
> OFName.lpstrInitialDir = InitialDir
> 'Set the dialog title
> OFName.lpstrTitle = DialogTitle
> 'no extra flags
> OFName.flags = 0
> 'Show the 'Open File' dialog
> If GetOpenFileName(OFName) Then
> ShowOpen = Trim(OFName.lpstrFile)
>
> Else
> ShowOpen = ""
> End If
> End Function
>
>
>
> Private Sub cmdShowOpen_Click()
> Dim Filter As String
> Dim InitialDir As String
> Dim DialogTitle As String
>
> Filter = "Drawing Files (*.dwg)" + Chr$(0) + "*.dwg" + Chr$(0) + "All
> Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)
> InitialDir = "H:\0blocks\HARDWARE"
> DialogTitle = "Open a DWG file"
>
> Label1.Caption = ShowOpen(Filter, InitialDir, DialogTitle)
> End Sub
>
>
> **
> The following is from module1 where ***** should be the file name
> Set blockRefObj = ThisDrawing.ModelSpace.InsertBlock(p1, ******, 1#, 1#, 1#,
> angle)
>
>
>
>
>