Try
oWord.DisplayAlerts = .F.
>I have to search all ms word documents that contain specific text.
>
>[I don't use with window search since Windows search (and vfp filer) doesn't support seraching HEBREW text inside doc.
>In addition, I have to control the users access &to manipulate the docs within VFP.]
>
>
>
>I have cursor (curwordfiles) with all the *.doc files.
>I scan that cursor, openning each document and if the string found (The code following on bottom) and I fill another cursor (curfiles) with this filename.
>
>It's work well (very very slowly, there is no alternative way), but when I scan the documents, Some word doc behave as following:
>
>1. Messagebox 'The file open by other user' ,MS word ask me few options, and after anyway start to open the all following scan document as visible and msword reopen again and again.
>
>2. Ask password.
>
>3. The doc protected and contain form fields - Cannot select\type and search.
>
>Ok
>I agree to ignore searching the text in this files (to get it in special list if possible), but vfp doesn't know about any problem (if the files ask password it's not error).
>
>How can I inform vfp to ignore this files without any message?
>
>Tnx
>
>Here is the code:
>
>
>local odocument, orange, oword,cwordfile,ctexttosearch
>oword = createobject("Word.Application")
>application.olerequestpendingtimeout = 0
>select curwordfiles
>scan
>cwordfile=alltrim(curwordfiles.filepath)+alltrim(curwordfiles.filename)
>odocument = oword.documents.open(cwordfile)
>orange=odocument.content
>with orange
>if .find.execute(ctexttosearch)
>insert into curfiles values (cwordfile)
>endif
>endwith
>endif
>endscan
>oword.quit(.f.)
--sb--