Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
MS Word in a VFP form
Message
De
01/03/2005 10:57:47
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
01/03/2005 08:04:58
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00991182
Message ID:
00991579
Vues:
19
Good you found it, didn't know could be used for showing toolbars.
Cetin

>Cetin,
>
>Thanks for the code, found "Procedure AutomateWord" indeed interesting, would never get to that approach.
>
>>Not to disencourage you but shouldn't expect word to behave normal.
>
>So far I could get web browser to show Word toolbars (please see below). The only issue I still have (hope it *really* is the last issue) is the "open/save" dialog.
>
>Regards,
>
>Fernando
>
>*Constants for ExecWB first parameter
>#DEFINE OLECMDID_OPEN 1
>#DEFINE OLECMDID_NEW 2
>#DEFINE OLECMDID_SAVE 3
>#DEFINE OLECMDID_SAVEAS 4
>#DEFINE OLECMDID_SAVECOPYAS 5
>#DEFINE OLECMDID_PRINT 6
>#DEFINE OLECMDID_PRINTPREVIEW 7
>#DEFINE OLECMDID_PAGESETUP 8
>#DEFINE OLECMDID_SPELL 9
>#DEFINE OLECMDID_PROPERTIES 10
>#DEFINE OLECMDID_CUT 11
>#DEFINE OLECMDID_COPY 12
>#DEFINE OLECMDID_PASTE 13
>#DEFINE OLECMDID_PASTESPECIAL 14
>#DEFINE OLECMDID_UNDO 15
>#DEFINE OLECMDID_REDO 16
>#DEFINE OLECMDID_SELECTALL 17
>#DEFINE OLECMDID_CLEARSELECTION 18
>#DEFINE OLECMDID_ZOOM 19
>#DEFINE OLECMDID_GETZOOMRANGE 20
>#DEFINE OLECMDID_UPDATECOMMANDS 21
>#DEFINE OLECMDID_REFRESH 22
>#DEFINE OLECMDID_STOP 23
>#DEFINE OLECMDID_HIDETOOLBARS 24
>#DEFINE OLECMDID_SETPROGRESSMAX 25
>#DEFINE OLECMDID_SETPROGRESSPOS 26
>#DEFINE OLECMDID_SETPROGRESSTEXT 27
>#DEFINE OLECMDID_SETTITLE 28
>#DEFINE OLECMDID_SETDOWNLOADSTATE 29
>#DEFINE OLECMDID_STOPDOWNLOAD 30
>
>*Constants for ExecWB second parameter
>#DEFINE OLECMDEXECOPT_DODEFAULT 0
>#DEFINE OLECMDEXECOPT_PROMPTUSER 1
>#DEFINE OLECMDEXECOPT_DONTPROMPTUSER 2
>#DEFINE OLECMDEXECOPT_SHOWHELP 3
>
> bLoaded = .F.
>
> cLoadFileName = "C:\Temp\Test.doc"
>
> oShowWordPage = CreateObj ("frmShowWordPage")
>
> oShowWordPage.Show ()
>
> Clear Events
>
> Define Class frmShowWordPage as Form
>*------ ----- --------------- -- ----
>
>        Height      = 600
>        Width       = 800
>        ControlBox  =  .T.
>        MaxButton   =  .T.
>        MinButton   =  .T.
>        Movable     =  .T.
>        ZoomBox     =  .T.
>        SizeBox     =  .T.
>        Name        = "frmShowWordPage"
>        Caption     = " Sample Word Editing Window"
>        Closable    =  .T.
>        Enabled     =  .T.
>        WindowType  =   1
>
>        Add Object oleBrowserWin  as oleControl  with Top               =   5, ;
>                                                      Left              =   5, ;
>                                                      Height            = 560, ;
>                                                      Width             = 790, ;
>                                                      Name              = "oleBrowserWin", ;
>                                                      OLEClass          = "Shell.Explorer.2"
>
>        Add Object cmdLoad      as CommandButton with Top               = 570, ;
>                                                      Left              =   5, ;
>                                                      Height            =  25, ;
>                                                      Width             =  75, ;
>                                                      FontName          =  "Arial", ;
>                                                      FontSize          =   8, ;
>                                                      Caption           = "\<Load"
>
>        Add Object cmdShowTBars as CommandButton with Top               = 570, ;
>                                                      Left              =  85, ;
>                                                      Height            =  25, ;
>                                                      Width             = 120, ;
>                                                      FontName          =  "Arial", ;
>                                                      FontSize          =   8, ;
>                                                      Caption           = "\<Show Tool Bars"
>
>        Add Object cmdCancel    as CommandButton with Top               = 570, ;
>                                                      Left              = 720, ;
>                                                      Height            =  25, ;
>                                                      Width             =  75, ;
>                                                      FontName          =  "Arial", ;
>                                                      FontSize          =   8, ;
>                                                      Cancel            = .T., ;
>                                                      Caption           = "\<Close"
>
>        Procedure cmdCancel.Click
>*                 --------- -----
>                  ThisForm.Release
>        EndProc
>
>        Procedure cmdLoad.Click
>*                 ------- -----
>                  ThisForm.oleBrowserWin.Navigate2 (cLoadFileName)
>
>                  bLoaded = .T.
>        EndProc
>
>        Procedure cmdShowTBars.Click
>*                 ------------ -----
>                  ThisForm.oleBrowserWin.ExecWB (OLECMDID_HIDETOOLBARS       , ;
>                                                 OLECMDEXECOPT_DONTPROMPTUSER, ;
>                                                 0                           , ;
>                                                 0)
>        EndProc
>
>        Procedure oleBrowserWin.Refresh
>*                 ------------- -------
>                  NoDefault
>        EndProc
>
>        Procedure oleBrowserWin.NavigateComplete2
>*                 ------------- -----------------
>                  LParameters PDisp, URL
>
>                  If bLoaded
>                     ThisForm.oleBrowserWin.ExecWB (OLECMDID_HIDETOOLBARS       , ;
>                                                    OLECMDEXECOPT_DONTPROMPTUSER, ;
>                                                    0                           , ;
>                                                    0)
>                  endif
>        EndProc
>
>        Procedure oleBrowserWin.Init
>*                 ------------- ----
>                  This.Navigate2 ("about:blank")
>        EndProc
>
>        Procedure Init
>*                 ----
>
>        EndProc
>
>        Procedure QueryUnload
>*                 -----------
>                  ThisForm.cmdCancel.Click
>
>                  NoDefault
>
>                  Return .T.
>        EndProc
>
> EndDefine
>
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform