|
|
Thread Tools | Display Modes |
#1
|
|||
|
|||
Use VBA to open the dialog box to All Files instead of All Word Documents
I have code that is automatically importing a csv file into microsoft word and saving it as a pdf file. You press the button and the macro automatically opens the dialog box where the user selects the csv file to import but every time the dialog box opens the default opens with "All Word Documents" selected (only viewing word docs) but I want the default to be "All Files" so that you can actually see the CSV files and not have to manually change it every time.
How can I change the dialog box so that it automatically opens with all "All Files" selected instead of "All Word Documents"? Here is the part of the code that prompts the dialog box: Options.DefaultFilePath(wdDocumentsPath) = "W:\Daily to Fortis\Today" With Dialogs(wdDialogInsertFile) .Name = "*.txt" .Show End With Thanks |
#2
|
||||
|
||||
Try:
Code:
Sub Demo() With Dialogs(wdDialogInsertFile) SendKeys "%n{TAB}t", True SendKeys "{TAB}{TAB}{TAB}{TAB}{ENTER}W:\Daily to Fortis\Today\{ENTER}", True .Show End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#3
|
||||
|
||||
Cross-posted (and responded to in a different way) at: http://www.vbaexpress.com/forum/show...Word-Documents
For cross-posting etiquette, please read: http://www.excelguru.ca/content.php?184
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
I cant open any word documents | jcelebrini | Word | 1 | 04-28-2011 03:28 PM |
Cant Paste using Open Dialog Box in word 2003 | aceton | Word | 0 | 12-03-2010 01:58 PM |
Open dialog unsafe? | jsyshaggy | Office | 0 | 09-22-2010 01:25 AM |
OFFICE(Word,Excel..)-crash/close when DIALOG BOX launched of insert image,open file | buggingme | Office | 1 | 05-30-2010 12:18 AM |
Excel Files Will Not Open From Documents Normally | tremaine | Excel | 1 | 06-17-2009 08:05 AM |