PeterMoran
MIS
Hi,
I have this macro in Excel to just display *.csv files in the Open Window:
Sub CSVOpen()
'
' CSVOpen Macro to Open Window for *.csv files in dir "Super"
'
Dim myFileName As Variant
Dim Wkbk As Workbook
ChDir "C:\Users\Peter\Documents\Super"
myFileName = Application.GetOpenFilename("Text Files (*.csv), *.csv", Title:="Please Select a File")
If myFileName = False Then
ChDir "C:\Users\Peter\Documents"
Exit Sub 'user hits Cancel
End If
Workbooks.OpenText Filename:=myFileName, _
DataType:=xlDelimited, Comma:=True 'Open selected file
ChDir "C:\Users\Peter\Documents" 'Reset CurDir to "Documents" for next use.
End Sub
I would like to have a similar macro in Word with just *.doc and *.docx files, which is not possible via the Ctrl+O window. I tend to have *.PDF files in the relevant folders which I don't want to show, but which Word insists on showing.
Any suggestions gratefully appreciated on how to do this for Word.
Peter Moran
I have this macro in Excel to just display *.csv files in the Open Window:
Sub CSVOpen()
'
' CSVOpen Macro to Open Window for *.csv files in dir "Super"
'
Dim myFileName As Variant
Dim Wkbk As Workbook
ChDir "C:\Users\Peter\Documents\Super"
myFileName = Application.GetOpenFilename("Text Files (*.csv), *.csv", Title:="Please Select a File")
If myFileName = False Then
ChDir "C:\Users\Peter\Documents"
Exit Sub 'user hits Cancel
End If
Workbooks.OpenText Filename:=myFileName, _
DataType:=xlDelimited, Comma:=True 'Open selected file
ChDir "C:\Users\Peter\Documents" 'Reset CurDir to "Documents" for next use.
End Sub
I would like to have a similar macro in Word with just *.doc and *.docx files, which is not possible via the Ctrl+O window. I tend to have *.PDF files in the relevant folders which I don't want to show, but which Word insists on showing.
Any suggestions gratefully appreciated on how to do this for Word.
Peter Moran