If you're always processing only a single folder, you can replace:
Code:
strFolder = GetFolder
If strFolder = "" Then Exit Sub
strFile = Dir(strFolder & "\*.doc", vbNormal)
with:
Code:
strFolder = "My file path \*.doc", vbNormal)
where 'My file path ' is your file path, and delete:
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
Set oFolder = Nothing
You should not make any changes other than the ones I posted - and you should make all of those; otherwise you can't expect the macro to work properly.
Note: Do not put the document holding the macro into the same folder as the files to be processed.