Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word is driving me crazy
Message
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Windows 2000 SP4
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01085228
Message ID:
01085336
Views:
13
< snip... >

I think I've finally isolated something. I just tried it in VFP8, and guess what! Yep, that's right. No problems. I can run those lines a dozen times in VFP8. That means that either there is a problem with VFP9 vs Win2K Sp4 vs Word 2002, or (more likely) something has gone belly up in my vfp9. Tomorrow I'm going to reinstall VFP9 and see what happens.

I'm going to hang onto the code below though.

Thanks for taking the time John.

>Sorry, I don't loan guns to anyone but family!<g>

>Have you tried shutting everything else down? (Outlook runs another Word session).
>
>Have you tried setting safety off, or is it reporting the error from Word also?
>
>I seem to recall running into something like this, and it may have been because of an orphaned instance of Word. Try running George Tasker's is_run32 to see if there is another instance of Word running.
>
>Here is his code if you don't have it:
>
>* FUNCTION: Is_Run32.prg
>* AUTHOR: George Tasker
>* DATE: January 13, 1998 - 8:26 AM
>* PURPOSE: Determines if a Windows
>* application is running and returns
>* the handle of the window if it is,
>* otherwise returns 0. 32 bit version
>* for Windows 95/NT 3.51-4
>
>LPARAMETER pctitle
>
>* Parameter list description
>*
>* pctitle - The title bar of the Window
>*   Note: The title does not have to be
>*   the complete title that appears
>*
>*
>* API Declarations
>DECLARE INTEGER GetActiveWindow IN Win32API
>DECLARE INTEGER GetWindow IN Win32API;
>  INTEGER hwnd, INTEGER dflag
>DECLARE INTEGER GetWindowText IN Win32API ;
>  INTEGER hwnd, STRING @lptstr, INTEGER cbmax
>
>LOCAL lnhwnd, lnnext, lldone, lctitle_bar, lcsearchfor,;
>  lntext_len
>lcsearchfor = UPPER(ALLTRIM(pctitle))
>lnhwnd = GetActiveWindow()
>lnnext = 2
>lldone = .F.
>lctitle_bar = ""
>DO WHILE NOT lldone
>  IF NOT EMPTY(lnhwnd)
>    lctitle_bar = SPACE(200) + CHR(0)
>    lntext_len = GetWindowText(lnhwnd, @lctitle_bar, 200)
>    lctitle_bar = UPPER(LEFT(lctitle_bar, lntext_len))
>    lldone = (lcsearchfor $ lctitle_bar)
>    IF NOT lldone
>      lnhwnd = GetWindow(lnhwnd, lnnext)
>    ENDIF
>  ELSE
>    lldone = .T.
>  ENDIF
>ENDDO
>RETURN lnhwnd
>
>?is_run32 ('MICROSOFT WORD')
Previous
Reply
Map
View

Click here to load this message in the networking platform