Some questions about OLE

Post Reply
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Some questions about OLE

Post by driessen »

Hello,

I use OLE to build a connection between my application and Word, Excel and Outlook. Since I have a huge agenda in my application, it is a dream from me and my customers (lawyers) to build a synchronisation between my application and Outlook because through Outlook the can synchronise with their mobile phone or their PDA. (Perhaps FiveWin for PPC is a possibility in the future).

1. Where can I find a list of the OLE-commands and -functions which can be used in FiveWin and xHarbour ?

2. Where can I find some more information about the correct syntax of these commands ?

3. Does anyone have any experience in developing a synchronisation between a FW-application and Outlook ?

4. A question about a current problem : how can I check through OLE that there is still a document opened (no matter which one) in Word ?

Thank you very much in advance.

Regards,

Michel
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Frank Demont
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Post by Frank Demont »

1. Where can I find a list of the OLE-commands and -functions which can be used in FiveWin and xHarbour ?

c:\program Files\Microsoft Office\OFFICE11\1043\VBAOL11.chm


4. A question about a current problem : how can I check through OLE that there is still a document opened (no matter which one) in Word ?

// sorry , just tested , it doesn't work
TRY
oWord := GetActiveObject( "Word.Application" )
CATCH
? "No word document"
END

Frank
User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Frank,

Thanks for your answer.

But ...

1. How do I implement the OLE-commands and -functions, mentioned in VBAOL11.chm, in the FiveWin syntax ?

4. Your suggestion is not quite a solution.

In my application I have a sentence :

OleInvoke(hActiveDoc,"Close")

This sentence closes my Word-document.

But if the user has closed the Word-document manually, I got an error "No exported method: Close" in "OleInvoke(0).

I think that your suggestion only checks if the OLE to Word is still active, doesn't it ?

Thank you.

Regards,

Michel
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Frank Demont
Posts: 142
Joined: Sun Oct 09, 2005 10:59 am

Post by Frank Demont »

Michel ,

If you know the filename , you can :

Code: Select all

DO WHIL .T.
    hWnd := FINDWND( cFileName ) 
    IF !EMPTY( hWnd ) 
        ? "Tijdelijke rtf-file is nog niet gesloten : " + CRLF + GETWINDOWTEXT( hWnd )
        ? "Het programma probeert dit nu zelf te doen "
        SENDMESSAGE( hWnd, 16 ) 
       //CloseWindow(hWnd) 
  ELSE
     EXIT
  END
END





// Uit http://fivetechsoft.com/forums/viewtopic.php?t=1346&start=0&postdays=0&postorder=asc&highlight=findwindow%2A
#define GW_HWNDFIRST 0 
#define GW_HWNDLAST  1 
#define GW_HWNDNEXT  2 
#define GW_HWNDPREV  3 
#define GW_OWNER     4 
#define GW_CHILD     5 

FUNCTION FINDWND( cTitle ) 

    LOCAL hWnd := GETWINDOW( GETDESKTOPWINDOW(), GW_CHILD ) 

    WHILE hWnd != 0 
        IF UPPER( cTitle ) $ UPPER( GETWINDOWTEXT( hWnd ) ) 
            RETURN hWnd 
        ENDIF 

        hWnd = GETWINDOW( hWnd, GW_HWNDNEXT ) 
    ENDDO 

    RETURN NIL 

User avatar
driessen
Posts: 1239
Joined: Mon Oct 10, 2005 11:26 am
Location: Genk, Belgium

Post by driessen »

Frank,

Thanks for your help.

I'll try it out.

Michel
Regards,

Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 21.01 - Harbour 3.2.0 (October 2020) - xHarbour Builder (January 2020) - Bcc7
Post Reply