F
FIRSTROUNDKO via OfficeKB.com
Hi!
I am trying to adapt some code for my needs however, whilst the message is
correct.
An error message says the file cannot be found?
Thanks for you help in advance.
Sub Something()
Dim cCol As Collection
Dim sStr As String
Dim lCnt As Long
Set cCol = New Collection
sStr = Dir("C:\man\*.doc", vbNormal)
While sStr <> ""
cCol.Add sStr
sStr = Dir
Wend
For lCnt = 1 To cCol.Count
MsgBox cCol.Item(lCnt)
Documents.Open cCol.Item(lCnt)
' your code, beware of what you are doing
ActiveDocument.Close
Next
End Sub
I am trying to adapt some code for my needs however, whilst the message is
correct.
An error message says the file cannot be found?
Thanks for you help in advance.
Sub Something()
Dim cCol As Collection
Dim sStr As String
Dim lCnt As Long
Set cCol = New Collection
sStr = Dir("C:\man\*.doc", vbNormal)
While sStr <> ""
cCol.Add sStr
sStr = Dir
Wend
For lCnt = 1 To cCol.Count
MsgBox cCol.Item(lCnt)
Documents.Open cCol.Item(lCnt)
' your code, beware of what you are doing
ActiveDocument.Close
Next
End Sub