<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: VBA Open File with Dialog Box in VBA Forum</title>
    <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726575#M32087</link>
    <description>Ed&lt;BR /&gt;
&lt;BR /&gt;
Understand now that i am green. And i am reading about API's on msdn.com but in the mean time i am lost again.&lt;BR /&gt;
&lt;BR /&gt;
As you suggested i have set multiselect to true but i must not be setting the correct thing becasue it is still only accepting one file. &lt;BR /&gt;
&lt;BR /&gt;
Would you mind offereing an example of setting multiselect to true?&lt;BR /&gt;
&lt;BR /&gt;
thanks for you help.&lt;BR /&gt;
&lt;BR /&gt;
jimd</description>
    <pubDate>Mon, 21 May 2007 15:18:02 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2007-05-21T15:18:02Z</dc:date>
    <item>
      <title>VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726554#M32066</link>
      <description>Just thought I would post this because I have been looking for a working VBA file open dialog box solution for awhile. I'm an old autolisped making the jump to VBA and I have seen and read various solutons for the equivalent getfiled autolisp function but I never had much luck with them. This one worked for me it uses the Win API to do the job. &lt;BR /&gt;
&lt;BR /&gt;
Private Declare Function GetOpenFileName Lib "comdlg32.dll" Alias _&lt;BR /&gt;
"GetOpenFileNameA" (pOpenfilename As OPENFILENAME) As Long&lt;BR /&gt;
Private Type OPENFILENAME&lt;BR /&gt;
lStructSize As Long&lt;BR /&gt;
hwndOwner As Long&lt;BR /&gt;
hInstance As Long&lt;BR /&gt;
lpstrFilter As String&lt;BR /&gt;
lpstrCustomFilter As String&lt;BR /&gt;
nMaxCustFilter As Long&lt;BR /&gt;
nFilterIndex As Long&lt;BR /&gt;
lpstrFile As String&lt;BR /&gt;
nMaxFile As Long&lt;BR /&gt;
lpstrFileTitle As String&lt;BR /&gt;
nMaxFileTitle As Long&lt;BR /&gt;
lpstrInitialDir As String&lt;BR /&gt;
lpstrTitle As String&lt;BR /&gt;
flags As Long&lt;BR /&gt;
nFileOffset As Integer&lt;BR /&gt;
nFileExtension As Integer&lt;BR /&gt;
lpstrDefExt As String&lt;BR /&gt;
lCustData As Long&lt;BR /&gt;
lpfnHook As Long&lt;BR /&gt;
lpTemplateName As String&lt;BR /&gt;
End Type&lt;BR /&gt;
Public Function ShowOpen(Filter As String, _&lt;BR /&gt;
InitialDir As String, _&lt;BR /&gt;
DialogTitle As String) As String&lt;BR /&gt;
Dim OFName As OPENFILENAME&lt;BR /&gt;
'Set the structure size&lt;BR /&gt;
OFName.lStructSize = Len(OFName)&lt;BR /&gt;
'Set the owner window&lt;BR /&gt;
OFName.hwndOwner = 0&lt;BR /&gt;
'Set the filter&lt;BR /&gt;
OFName.lpstrFilter = Filter&lt;BR /&gt;
'Set the maximum number of chars&lt;BR /&gt;
OFName.nMaxFile = 255&lt;BR /&gt;
'Create a buffer&lt;BR /&gt;
OFName.lpstrFile = Space(254)&lt;BR /&gt;
&lt;BR /&gt;
'Create a buffer&lt;BR /&gt;
OFName.lpstrFileTitle = Space$(254)&lt;BR /&gt;
'Set the maximum number of chars&lt;BR /&gt;
OFName.nMaxFileTitle = 255&lt;BR /&gt;
'Set the initial directory&lt;BR /&gt;
OFName.lpstrInitialDir = InitialDir&lt;BR /&gt;
'Set the dialog title&lt;BR /&gt;
OFName.lpstrTitle = DialogTitle&lt;BR /&gt;
'no extra flags&lt;BR /&gt;
OFName.flags = 0&lt;BR /&gt;
'Show the 'Open File' dialog&lt;BR /&gt;
If GetOpenFileName(OFName) Then&lt;BR /&gt;
ShowOpen = Trim(OFName.lpstrFile)&lt;BR /&gt;
Else&lt;BR /&gt;
ShowOpen = ""&lt;BR /&gt;
End If&lt;BR /&gt;
End Function&lt;BR /&gt;
&lt;BR /&gt;
Make a form and place the following code listed below on a button to call the showopen routine.&lt;BR /&gt;
&lt;BR /&gt;
Private Sub CommandButton1_Click()&lt;BR /&gt;
Dim Filter As String&lt;BR /&gt;
Dim InitialDir As String&lt;BR /&gt;
Dim DialogTitle As String&lt;BR /&gt;
Dim OutputStr As String&lt;BR /&gt;
&lt;BR /&gt;
Filter = "Drawing Files (*.dwg)" + Chr$(0) + "*.dwg" + Chr$(0) + _&lt;BR /&gt;
"All Files (*.*)" + Chr$(0) + "*.*" + Chr$(0)&lt;BR /&gt;
InitialDir = "C:\Program Files\AutoCAD 2006\Sample"&lt;BR /&gt;
DialogTitle = "Open a DWG file"&lt;BR /&gt;
OutputStr = ShowOpen(Filter, InitialDir, DialogTitle)&lt;BR /&gt;
MsgBox OutputStr&lt;BR /&gt;
End Sub</description>
      <pubDate>Fri, 04 Aug 2006 16:18:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726554#M32066</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-04T16:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726555#M32067</link>
      <description>I found this website very good and ended up using this as my module class for file dialogues:&lt;BR /&gt;
&lt;BR /&gt;
http://vbnet.mvps.org/code/comdlg/fileopendlg.htm</description>
      <pubDate>Mon, 07 Aug 2006 11:27:07 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726555#M32067</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-08-07T11:27:07Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726556#M32068</link>
      <description>I've got the exact same routine from Joe Sutphin's book "AutoCAD 2004 VBA"...&lt;BR /&gt;
&lt;BR /&gt;
I can get both the File Open and File Save" boxes to display and I can navigate the folder hierarchy, and even select a file...&lt;BR /&gt;
&lt;BR /&gt;
But NOTHING happens, nothing opens, nothing gets saved...I think I am minus an important step somewhere...something to do with linking the dialog control with the actual AutoCAD session...&lt;BR /&gt;
&lt;BR /&gt;
But what do I know!!!!! FRUSTRATING!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Still trying...can anyone help?</description>
      <pubDate>Tue, 07 Nov 2006 23:15:30 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726556#M32068</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-07T23:15:30Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726557#M32069</link>
      <description>I've got the exact same routine from Joe Sutphin's book "AutoCAD 2004 VBA"...&lt;BR /&gt;
&lt;BR /&gt;
I can get both the File Open and File Save" boxes to display and I can navigate the folder hierarchy, and even select a file...&lt;BR /&gt;
&lt;BR /&gt;
But NOTHING happens, nothing opens, nothing gets saved...I think I am minus an important step somewhere...something to do with linking the dialog control with the actual AutoCAD session...&lt;BR /&gt;
&lt;BR /&gt;
But what do I know!!!!! FRUSTRATING!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Still trying...can anyone help?</description>
      <pubDate>Tue, 07 Nov 2006 23:18:59 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726557#M32069</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-07T23:18:59Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726558#M32070</link>
      <description>&lt;PELLACAD&gt; wrote in message news:5388504@discussion.autodesk.com...&lt;BR /&gt;
I've got the exact same routine from Joe Sutphin's book "AutoCAD 2004&lt;BR /&gt;
VBA"...&lt;BR /&gt;
&lt;BR /&gt;
I can get both the File Open and File Save" boxes to display and I can&lt;BR /&gt;
navigate the folder hierarchy, and even select a file...&lt;BR /&gt;
&lt;BR /&gt;
But NOTHING happens, nothing opens, nothing gets saved...I think I am minus&lt;BR /&gt;
an important step somewhere...something to do with linking the dialog&lt;BR /&gt;
control with the actual AutoCAD session...&lt;BR /&gt;
&lt;BR /&gt;
But what do I know!!!!! FRUSTRATING!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Still trying...can anyone help?&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Hi Pellacad,&lt;BR /&gt;
&lt;BR /&gt;
Not sure what you mean by exact same routine...but if you mean a wrapper for&lt;BR /&gt;
the api call i mentioned, the return value is a string.&lt;BR /&gt;
The string is the name of the file(s) you selected.&lt;BR /&gt;
What you do with that filename is up to you to program.&lt;BR /&gt;
What exactly are you trying to accomplish and what code do you have so far?&lt;BR /&gt;
Post what you have and where you're stuck and it would be easier for someone&lt;BR /&gt;
to help.&lt;BR /&gt;
&lt;BR /&gt;
for example IF you want acad to open the file,&lt;BR /&gt;
and IF you have a reference to acadapplication oAcadApp&lt;BR /&gt;
and IF you are in mdi mode,&lt;BR /&gt;
and IF the return value was one filename,&lt;BR /&gt;
and IF it was set to the variable sFileName&lt;BR /&gt;
Then...&lt;BR /&gt;
&lt;BR /&gt;
oAcadapp.Documents.Open sFileName&lt;BR /&gt;
&lt;BR /&gt;
would open the drawing.&lt;BR /&gt;
:-)&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
hth&lt;BR /&gt;
Mark&lt;/PELLACAD&gt;</description>
      <pubDate>Tue, 07 Nov 2006 23:40:50 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726558#M32070</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-07T23:40:50Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726559#M32071</link>
      <description>Hi,&lt;BR /&gt;
&lt;BR /&gt;
All the file dialog does is return a string of the file name selected.&lt;BR /&gt;
&lt;BR /&gt;
It's up to you to write code which uses that string.&lt;BR /&gt;
&lt;BR /&gt;
-- &lt;BR /&gt;
Regards&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Laurie Comerford&lt;BR /&gt;
www.cadapps.com.au&lt;BR /&gt;
www.civil3dtools.com&lt;BR /&gt;
&lt;PELLACAD&gt; wrote in message news:5388551@discussion.autodesk.com...&lt;BR /&gt;
I've got the exact same routine from Joe Sutphin's book "AutoCAD 2004 &lt;BR /&gt;
VBA"...&lt;BR /&gt;
&lt;BR /&gt;
I can get both the File Open and File Save" boxes to display and I can &lt;BR /&gt;
navigate the folder hierarchy, and even select a file...&lt;BR /&gt;
&lt;BR /&gt;
But NOTHING happens, nothing opens, nothing gets saved...I think I am minus &lt;BR /&gt;
an important step somewhere...something to do with linking the dialog &lt;BR /&gt;
control with the actual AutoCAD session...&lt;BR /&gt;
&lt;BR /&gt;
But what do I know!!!!! FRUSTRATING!!!!!!!!!!!!!!!!!!!!!!&lt;BR /&gt;
&lt;BR /&gt;
Still trying...can anyone help?&lt;/PELLACAD&gt;</description>
      <pubDate>Tue, 07 Nov 2006 23:42:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726559#M32071</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-11-07T23:42:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726560#M32072</link>
      <description>I can get the code to work to open the dialog box and get the message to open. How do I get the OutputStr passed to other modules in the project? &lt;BR /&gt;
&lt;BR /&gt;
I have attached the project I am working on, most of the code is copied from posts in the group which is beyond my level of competence. Thanks to all that I have copied.&lt;BR /&gt;
&lt;BR /&gt;
Christopher Fugitt</description>
      <pubDate>Mon, 04 Dec 2006 00:08:42 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726560#M32072</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2006-12-04T00:08:42Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726561#M32073</link>
      <description>I figured out how to pass the variable to other modules, make it a global variable at the top. &lt;BR /&gt;
&lt;BR /&gt;
When I make the OutputStr = LayFile it won't let me add anything to the string later on in the program, it just cuts it off. Is there a way to add to this string? What causes it not to be addable?</description>
      <pubDate>Wed, 06 Dec 2006 06:13:53 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726561#M32073</guid>
      <dc:creator>Civil3DReminders_com</dc:creator>
      <dc:date>2006-12-06T06:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726562#M32074</link>
      <description>&lt;CHRISTOPHERF&gt; wrote in message news:5416106@discussion.autodesk.com...&lt;BR /&gt;
I figured out how to pass the variable to other modules, make it a global&lt;BR /&gt;
variable at the top.&lt;BR /&gt;
&lt;BR /&gt;
When I make the OutputStr = LayFile it won't let me add anything to the&lt;BR /&gt;
string later on in the program, it just cuts it off. Is there a way to add&lt;BR /&gt;
to this string? What causes it not to be addable?&lt;BR /&gt;
&lt;BR /&gt;
I haven't looked at your attachment but assuming you're using an api wrapper&lt;BR /&gt;
as originally posted, the string is created in a fixed length buffer&lt;BR /&gt;
&lt;BR /&gt;
from op&lt;BR /&gt;
'Create a buffer&lt;BR /&gt;
OFName.lpstrFile = Space(254)&lt;BR /&gt;
&lt;BR /&gt;
you'd have to create a variable length string variable if you want more&lt;BR /&gt;
characters&lt;BR /&gt;
&lt;BR /&gt;
Dim sAnyString as String&lt;/CHRISTOPHERF&gt;</description>
      <pubDate>Wed, 06 Dec 2006 13:53:51 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726562#M32074</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2006-12-06T13:53:51Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726563#M32075</link>
      <description>If i might ask, i am building a batch plot routine specific to what we do here and need this openfile routine to allow multiple selection and have the drawings names stored in a single column array variable.&lt;BR /&gt;
&lt;BR /&gt;
I am a little new to VBA and expert at lisp and i have your code for a single file name working great. Thank you for that. Would you help me out with the multiple selection?&lt;BR /&gt;
&lt;BR /&gt;
thank you for your help.</description>
      <pubDate>Fri, 27 Apr 2007 23:18:34 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726563#M32075</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-04-27T23:18:34Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726564#M32076</link>
      <description>Attached is my own class for file dialogs. I started with some code from a website that is now defunct. It was similar to what what posted here in that is only dealt with single files. I've added code that allows for multiple file selection, filtering, as well as other properties. It also support the BrowseForFolder dialog.</description>
      <pubDate>Mon, 30 Apr 2007 15:06:19 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726564#M32076</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-04-30T15:06:19Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726565#M32077</link>
      <description>Ed&lt;BR /&gt;
&lt;BR /&gt;
Thanks for the file. i am a little new at VBA so maybe you might give me a few hints as to where to put these.&lt;BR /&gt;
&lt;BR /&gt;
I am familar with the VBA interface and am just now learning public proceedures and public variables. I am taking a class in Office VBA.&lt;BR /&gt;
&lt;BR /&gt;
I am expert at lisp but new to VBA.&lt;BR /&gt;
&lt;BR /&gt;
I am assuming this does not all go in one place. Just mention where each part goes if you will. You are welcome to start out brief and if i have questions i can reply again.&lt;BR /&gt;
&lt;BR /&gt;
jimd</description>
      <pubDate>Tue, 01 May 2007 22:30:10 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726565#M32077</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-01T22:30:10Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726566#M32078</link>
      <description>These? Its one single file, a class file. Save the zip to your hd, extract it. Open your dvb and rt+clk in the Project Browser and select Import...&lt;BR /&gt;
&lt;BR /&gt;
Now you can create instances of the class in other modules as discussed elsewhere in this thread, i.e.&lt;BR /&gt;
Dim MyDialog As New FileDialog&lt;BR /&gt;
'set dialog props as req'd&lt;BR /&gt;
'issue Open method, etc.</description>
      <pubDate>Thu, 03 May 2007 14:39:15 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726566#M32078</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-05-03T14:39:15Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726567#M32079</link>
      <description>Ed&lt;BR /&gt;
&lt;BR /&gt;
i guess i don;t know as much as i thought i did. I am not at all clear on how to run this class that you gave me.&lt;BR /&gt;
&lt;BR /&gt;
If you would help, here is what i am trying to accomplish.&lt;BR /&gt;
&lt;BR /&gt;
I want the user to click a button and the dialog box open. the user can browse to a directory of his choice and select one or more drawings. then push an open button (command button) and then the routine will store the full path of all the seleceted drawings to an array or something that i can then make use of in the rest of my program.&lt;BR /&gt;
  &lt;BR /&gt;
If you can give me an example of how to write the event code that will make this happen i would appreciate it.&lt;BR /&gt;
&lt;BR /&gt;
I would think this would be something nearly every autocad vba enthusiast would need. i am surpised it has been so hard to find examples of this kind of code.&lt;BR /&gt;
&lt;BR /&gt;
your class seems to come the closest to what i need except i am not sure how to call it.&lt;BR /&gt;
&lt;BR /&gt;
if you can help let me know. If you don't have the time i will just keep looking.&lt;BR /&gt;
&lt;BR /&gt;
thanks for your help.&lt;BR /&gt;
&lt;BR /&gt;
jimd</description>
      <pubDate>Wed, 16 May 2007 05:28:21 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726567#M32079</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-16T05:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726568#M32080</link>
      <description>Hi everybody,&lt;BR /&gt;
Just checking for a possibility. Is it possible to show the dialogue box on double clicking the drawing container window? I have seen the functionality in some other applications. Is it possible using windows API?</description>
      <pubDate>Wed, 16 May 2007 08:06:27 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726568#M32080</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-16T08:06:27Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726569#M32081</link>
      <description>Just add your code to the form's double click event.</description>
      <pubDate>Thu, 17 May 2007 15:11:33 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726569#M32081</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-05-17T15:11:33Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726570#M32082</link>
      <description>Here is a sample. For a better understanding, you need to read up on the api functions used at msdn.com&lt;BR /&gt;
[code]&lt;BR /&gt;
&lt;BR /&gt;
Public Sub OpenFile()&lt;BR /&gt;
    'sample to show how to use FileDialogs&lt;BR /&gt;
    Dim objFile As FileDialogs&lt;BR /&gt;
    Dim strFilter As String&lt;BR /&gt;
    Dim strFileName As String&lt;BR /&gt;
    &lt;BR /&gt;
    Set objFile = New FileDialogs&lt;BR /&gt;
    'desc,filter combinations must all be separated with pipe char "|"&lt;BR /&gt;
    strFilter = "All Files (*.*)|*.*|Drawings (*.dwg)|*.dwg"&lt;BR /&gt;
    objFile.Title = "Open a drawing"&lt;BR /&gt;
    'default dir is CurDir&lt;BR /&gt;
    objFile.StartInDir = "c:\"&lt;BR /&gt;
    objFile.Filter = strFilter&lt;BR /&gt;
    'return a valid filename&lt;BR /&gt;
    strFileName = objFile.ShowOpen&lt;BR /&gt;
    If Not strFileName = vbNullString Then&lt;BR /&gt;
        'use this space to perform operation&lt;BR /&gt;
        MsgBox strFileName&lt;BR /&gt;
    End If&lt;BR /&gt;
    Set objFile = Nothing    &lt;BR /&gt;
    &lt;BR /&gt;
End Sub[/code]&lt;BR /&gt;
&lt;BR /&gt;
However, this is not the class I had in mind. The Open dialog only retrieves one file at a time. I'll have to look again for the other work I did. The only change I made to this file was to allow for longer file names. The original had a 254 char limit.</description>
      <pubDate>Thu, 17 May 2007 15:43:36 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726570#M32082</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-05-17T15:43:36Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726571#M32083</link>
      <description>Ed&lt;BR /&gt;
&lt;BR /&gt;
thanks, i will try your sample code and i will study up on API's.&lt;BR /&gt;
&lt;BR /&gt;
You mentioned this is not for multiple file selection afterall. If you find your work for multiple file selection i would appreciate having a look.&lt;BR /&gt;
&lt;BR /&gt;
thanks for your help. I couldn't do this with out it.&lt;BR /&gt;
&lt;BR /&gt;
jimd</description>
      <pubDate>Thu, 17 May 2007 16:06:39 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726571#M32083</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-17T16:06:39Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726572#M32084</link>
      <description>Sorry, I was looking at an older version. The attached class does have a MultiSelect property.&lt;BR /&gt;
&lt;BR /&gt;
If you set that property to true and the user selects multiple files, then the ShowOpen method will return a string in the format: "Path file1 file2" where the spaces in the string are actually vbNullChar. In the following msdn article, at the bottom in the Show() method, is some code to handle separating the various filenames from the single string. In the example I gave you, the MsBox will only show the path. You need to step through the code in break mode to see what the string actually looks like.&lt;BR /&gt;
&lt;BR /&gt;
http://msdn2.microsoft.com/en-us/library/aa155724(office.10).aspx</description>
      <pubDate>Thu, 17 May 2007 16:09:12 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726572#M32084</guid>
      <dc:creator>Ed__Jobe</dc:creator>
      <dc:date>2007-05-17T16:09:12Z</dc:date>
    </item>
    <item>
      <title>Re: VBA Open File with Dialog Box</title>
      <link>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726573#M32085</link>
      <description>Hi Ed Jobe,&lt;BR /&gt;
           Thanks for the reply. Unfortunately, AutoCAD does not have a double click action for the Application. If I have the application window handle (Application.hwnd), then how can I write code for the double click action for that object ? Is it possible using Windows API?. I am sorry to be an absolute beginner in Windows API programming. I also read that if the API programming is not done properly, it will backfire damaging the application files.&lt;BR /&gt;
&lt;BR /&gt;
Thanks for any advice in this matter.</description>
      <pubDate>Sat, 19 May 2007 05:54:29 GMT</pubDate>
      <guid>https://forums.autodesk.com/t5/vba-forum/vba-open-file-with-dialog-box/m-p/1726573#M32085</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2007-05-19T05:54:29Z</dc:date>
    </item>
  </channel>
</rss>

