There is no one place to look - the subject is too broad. In this case,
although you are using VBScript, you are trying to access Word documents
within it using the Word object model, so that would be where to look. For
formal documentation - what there is of it, and for what little it's worth -
msdn (perhaps start here:
http://msdn.microsoft.com/en-gb/office/aa905482.aspx) and/or technet are a
starting point. For a different view, see the Word MVPs site at
http://word.mvps.org/FAQs/MacrosVBA/index.htm.
--
Enjoy,
Tony
www.WordArticles.com
You seem to be confusing working with text files and documents, and I
don't
really see what you're trying to do but to search a word document, try
something like
With objFile1.Content
If .Find.Execute("whatever you want") then .select
end with
I would look at Word Help for more information.
--
Enjoy,
Tony
www.WordArticles.com
- Show quoted text -
Hi Tony,
Thanks a lot for your help. iam done with the code below. I am using
".Paragraphs.Count" in the for loop
but i am never aware of it. only thing is i found it through google.
My question is where can i find those stuff. i had searched in some
reputed VB scripts books i could't find. is google only the way. I
think every body has this question in mind. kindly reply me.
Public Function String_Search(strExpectedString, strFilePath)
Set wrdApp = CreateObject("Word.Application")
wrdApp.DisplayAlerts = True
wrdApp.Visible = True
Set wrdDoc = wrdApp.Documents.Open(strFilePath, 1, True)
Dim blnFlag
With wrdDoc
blnFlag = False
For p = 1 To .Paragraphs.Count
startRange = .Paragraphs(p).Range.Start
endRange = .Paragraphs(p).Range.End
Set tRange = .Range(startRange, endRange)
tRange.Find.Text = strExpectedString
tRange.Find.Execute
If (tRange.Find.Found) Then
blnFlag = True
Exit For
End If
Next
End With
If( blnFlag = True) Then
Reporter.ReportEvent micPass,"Check for String", "The Expected
String Was Found in the specified document"
Else
Reporter.ReportEvent micFail,"Check for String", "The Expected
String Was Not Found in the specified document"
End If
wrdApp.Quit 0
End Function