Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Open a word doc in modal form??
Message
 
 
À
19/06/2007 09:29:56
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Versions des environnements
Visual FoxPro:
VFP 9
Divers
Thread ID:
01234220
Message ID:
01234244
Vues:
18
>can I open a worddoc so it is in a modal window?
>so my program waits until word gets closed??
>
>
>Thanks
>
>
>peter

Hi Peter,

There is an interesting idea recently discussed in a Russian site at http://forum.foxclub.ru/read.php?29,276949,279499#msg-279499

I made a quick test, created a modal form and put this code in the Init:
DECLARE SetParent IN user32 integer hWndChild, integer hWndParent    
    
  DECLARE integer SetWindowPos IN User32 ;    
    	integer Wnd_handler, integer Window_Order, ;    
    		integer X1, integer Y1, integer X2, integer Y2, integer wFlags    
    		    		  
  DECLARE LONG FindWindow IN Win32API ;    
        STRING lpClassName;    
        ,STRING lpWindowName    
          		  
    loWord = CREATEOBJECT( 'WORD.APPLICATION')   
    lcFile = GETFILE('doc') 
    loDoc=m.loWord.Documents.Add(m.lcFile)   
      
    _PP=lodoc.name +" - "+loword.CAPTION  
     
    word_hwnd=FindWindow(NULL,_pp)   
    SetParent( word_hwnd, thisform.HWnd)  
    setWindowPos( word_hwnd,0,0,INT(THISFORM.Height/2),THISFORM.Width-1,THISFORM.HEIGHT-1,0)   
    loword.ActiveWindow.ActivePane.View.Zoom.PageFit = 1  
    
  loword.VISIBLE=.T.
Code from this thread, I didn't try to play with it much. I think it may be a starting point.
If it's not broken, fix it until it is.


My Blog
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform