Public Function fnFindInWordDocument(strFilePath, strStringToFind)
Set oWord = CreateObject("Word.Application")
Set oDoc = oWord.Documents.Open(strFilePath)
isFound =False
For n = 1 To oDoc.Paragraphs.Count
startRange = oDoc.Paragraphs(n).Range.Start
endRange = oDoc.Paragraphs(n).Range.End
Set tRange = oDoc.Range(startRange, endRange)
tRange.Find.Text = strStringToFind
tRange.Find.Execute
If tRange.Find.Found Then
isFound =True
Exit For
End If
Next
If isFound =True Then
fnFindInWordDocument =True
Else
fnFindInWordDocument =False
End If
oDoc.Close
oWord.Quit
Set oDoc = Nothing
Set oWord = Nothing
End Function
Set oWord = CreateObject("Word.Application")
Set oDoc = oWord.Documents.Open(strFilePath)
isFound =False
For n = 1 To oDoc.Paragraphs.Count
startRange = oDoc.Paragraphs(n).Range.Start
endRange = oDoc.Paragraphs(n).Range.End
Set tRange = oDoc.Range(startRange, endRange)
tRange.Find.Text = strStringToFind
tRange.Find.Execute
If tRange.Find.Found Then
isFound =True
Exit For
End If
Next
If isFound =True Then
fnFindInWordDocument =True
Else
fnFindInWordDocument =False
End If
oDoc.Close
oWord.Quit
Set oDoc = Nothing
Set oWord = Nothing
End Function
Nice post! ui courses online
ReplyDeleteequips designers with both creative and technical skills.
A full stack Python developer course focuses on backend skills. It includes real-world projects. Practical learning enhances experience. Structured guidance improves clarity. This full stack python developer course supports success. It is dependable.
ReplyDeleteAn android app development course focuses on building functional Android apps. It combines theory with practical coding. This android app development course supports career growth. It is dependable.
ReplyDeleteExcellent insights! Well-designed database modeling course
ReplyDeleteensure consistency, accuracy, and long-term system growth.