![]() |
|
|
|
#1
|
||||
|
||||
|
FWIW, I still think the code should also include docx and docm files. For a minor coding efficiency improvement, I would also change the GetFolder function to add the trailing "" to the returned string. This would remove the need to include it separately 3 times in the calling macro.
Code:
Function GetFolder() As String
Dim oFolder As Object
GetFolder = ""
Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0)
If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path & Application.PathSeparator
Set oFolder = Nothing
End Function
__________________
Andrew Lockton Chrysalis Design, Melbourne Australia |
|
#2
|
||||
|
||||
|
Quote:
strFile = Dir(strFolder & "\*.doc", vbNormal) will return docx & docm files as well as doc files.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
How to open Documents folder directly from CTRL+O of Open folder on QAT
|
scvjudy | Word | 2 | 08-11-2014 10:58 PM |
Content of all documents in folder changes to match one of them
|
jemmac2525 | Word | 2 | 11-11-2013 12:32 AM |
| Office 2010 Can't Open Or Save Documents in My Documents Folder | trippb | Office | 1 | 07-12-2013 07:29 AM |
Documents saved to wrong folder
|
stevecarr | Word | 1 | 09-22-2011 05:32 AM |
| Loop through folder of workbooks and copy range to other workbook | Snvlsfoal | Excel Programming | 3 | 07-29-2011 05:55 AM |