Forums
New posts
Search forums
Members
Current visitors
Log in
Register
What's new
Search
Search
Search titles only
By:
New posts
Search forums
Menu
Log in
Register
Install the app
Install
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA Beginners
example source code for OpenFile and Save file using comdlg32.dl
JavaScript is disabled. For a better experience, please enable JavaScript in your browser before proceeding.
Reply to thread
Message
[QUOTE="Jonathan West, post: 5786833"] which directory to open in and what type of file it is to look for. The dialog box for Word only features 5 built in functions. None that I can use. I also need it to return only the file name (not the path with the file name). It needs the user to be able to open a excle file and then save a file in either the xls or snf file format. My books are not showing me this capability. Please prove them wrong. Not too hard. Yes, it can return the name only (in fact that is less code than for thr full pathname!) Preset the initial folder and the filetype, yes that can also be done. Try this Function GetOpenFileName(Folder as String, FileType as String) As String With Dialogs(wdDialogFileOpen) .Name = Folder .Name = FileType If .Display = -1 Then GetOpenFileName = .Name End If End With End Function As for saving the files in different formats, that is the business of your code, not of the dialog. Once you have the filename from the dialog, you can do whatever you want with it in your VBA code. All the common dialog would do is pass you the file name. [/QUOTE]
Verification
Post reply
Forums
Archive
Newsgroup Archive
Word Newsgroups
Word VBA Beginners
example source code for OpenFile and Save file using comdlg32.dl
Top