I am looping through a series of Word documents from Excel- this has been working fine, however, what I want to do is loop through them and ignore those documents which do not have the Keyword "CWS report (un processed)". I have tried this by adding a line that the main code will ignore a document that does not have this keyword. However, the loop is set to run until documents count = 0. What I want to do is to specify that the loop runs until there are no further documents with the above keyword. What I have so far is below, however, it causes an endless loop as it is. I am completely stumped!!!!
Do
Dim wdApp As Object
Dim wdDoc As Object
Dim NextRow As Long
Set wdApp = GetObject(, "Word.Application")
Set wdDoc = wdApp.ActiveDocument
wdApp.WindowState = wdWindowStateMinimize
If wdDoc.BuiltinDocumentProperties("Keywords").Value = "CWS report (un processed)" Then
'MAIN CODE GOES HERE
Loop Until wdApp.Documents.Count = 0
End If