i have vb sub under Excel, which returns this error: "Object doesnt support this property or method".
the code succesfully openes a word doc file, and cycles through each word in the doc.
i want to write a line saying: "if a word starts with the letters FLD then..."
but i keep getting this error message.
i tried using left and left$ (i dont know the difference but i saw the use of both), but both didnt work.
the code attached. can anyone tell me what i'm doing wrong?
Private Sub OK_Click()
'gets the path for the word file
path$ = findProposal.Label1
Function GetWordDoc(strPath As String) As Boolean
Dim objDoc As Object, objRange As Object, objAppWord As Object
Dim strNewPath As String
Dim wks As Worksheet
Dim n As Long
On Error GoTo err_handle
GetWordDoc = True
Set wks = ActiveWorkbook.Sheets("MergeSheet")
Set objDoc = GetObject(strPath, "Word.Document")
Set objAppWord = objDoc.Application
For n = 1 To objDoc.Words.Count
'this is the problematic line:
If Left(objDoc.Words.Text, 3) = "FLD" Then
GetWordDoc = False