Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 05-12-2014, 09:19 AM
spencerw.smith spencerw.smith is offline Use VBA to open the dialog box to All Files instead of All Word Documents Windows 7 64bit Use VBA to open the dialog box to All Files instead of All Word Documents Office 2010 64bit
Novice
Use VBA to open the dialog box to All Files instead of All Word Documents
 
Join Date: May 2014
Posts: 3
spencerw.smith is on a distinguished road
Default 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
Reply With Quote
  #2  
Old 05-13-2014, 01:32 AM
macropod's Avatar
macropod macropod is offline Use VBA to open the dialog box to All Files instead of All Word Documents Windows 7 32bit Use VBA to open the dialog box to All Files instead of All Word Documents Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
  #3  
Old 05-13-2014, 02:09 AM
macropod's Avatar
macropod macropod is offline Use VBA to open the dialog box to All Files instead of All Word Documents Windows 7 32bit Use VBA to open the dialog box to All Files instead of All Word Documents Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,963
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

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]
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Use VBA to open the dialog box to All Files instead of All Word Documents 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
Use VBA to open the dialog box to All Files instead of All Word Documents Excel Files Will Not Open From Documents Normally tremaine Excel 1 06-17-2009 08:05 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 03:27 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft