Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Ignore word messages
Message
From
09/06/2009 04:42:48
 
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9 SP2
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01404402
Message ID:
01404650
Views:
33
Thank you
You resolved it.

BTW
My (genius) client saved many word files with '' in the file name (double apostrophe ,not inverted commas), so I ignored searching all files whith this - I have same problem if the user type apostrophe in text box that used for contain value to retrieve by select query.
>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&&prevent 'Swith To...' problem(http://support.microsoft.com/kb/240809/en-us)
>>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.)
Thank you
Chaim
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform