Welcome To The Home Of The Visual FoxPro Experts  
home. signup. forum. archives. search. google. articles. downloads. faq. members. weblogs. sponsors. rss.
 From: a modi
  Where is a modi?
 delhi
 India
 a modi
 To: Ilya Rabyy
  Where is Ilya Rabyy?
 Fountain Valley
 California - United States
 Ilya Rabyy
 Tags
Subject: RE: Universal docs viewer?
Thread ID: 230489 Message ID: 235934 # Views: 24 # Ratings: 0
Version: Visual FoxPro 9 Category: Microsoft Office Automation
Date: Wednesday, July 29, 2009 4:25:52 PM         
   


> >
> > Ilya,
> >
> > I share with you my exercises, and as such they should be enhanced or even fixed to be in production. Please keep it in mind, and take them asis.
> >
> > I do not know why do you think that ActiveX control is better than just a form, but if you wish, I am attaching example with WebBrowser that works with doc file displaying it inside the control.
> > Also I am attaching TestWord example, similar to TestExcel example in my previous reply.
> >
> > Enjoy
> >
> > Yuri Rubinov
> > http://www.foxite.com/uploads/b7f07056-d33e-4fcb-9ac9-04f332bb5525.zip
> > http://www.foxite.com/uploads/c48c69ec-ad23-44bf-accf-767cb7e09c09.zip
Dear All,
I have tried to do the same with Office 2003 Windows XP and was able to see the xls file in the same form. But with Office 2007 i have problem of it opening in the new window.

I am giving you the sample code for the same and believe me it works. Try and send u a screen shot also. You can try on Office 2003 it will definitely work. So what i feel is we need to find a way to trick Office 2007 into doing same as Office 2003 this may solve the problem.

*********************
****put this code on button click and supply some file name
set safe off
set talk off

PUBLIC oForm
oForm = createobject('myExcelForm',m.lcXLSFile)
oForm.Windowstate = 0
*oForm.show()

define class myExcelForm as form
top = 102
left = 1
height = 160
width = 780
docreate = .t.
desktop = .f.
titlebar = 0
showwindow = 1
alwaysontop = .t.
closable = .f.
controlbox = .f.
movable = .f.


* caption = "HTML Excel sample"
* This is IE control - you'd use webbrowser4 from gallery instead
* just because it already has some checks, extra pem. ie: wouldn't need readystate part
* for the sake of keeping code short here I directly use olecontrol itself

add object htmlviewer as olecontrol with ;
top = 0, ;
left = 0, ;
height = 153, ;
width = 777, ;
visible = .t., ;
name = "HTMLViewer", ;
oleclass = 'Shell.Explorer'


procedure init
lparameters tcXLSFile
with thisform.htmlviewer
.Navigate2(m.tcXLSFile)
*!* .Navigate2('file://'+m.tcXLSFile)
do while .ReadyState # 4 && Wait for ready state
enddo
endwith
endproc
enddefine



COMPLETE THREAD
Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 7:36:19 PM
RE: Universal docs viewer? Posted by Mike Gagnon @ 6/5/2009 8:23:15 PM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 8:27:28 PM
RE: Universal docs viewer? Posted by Yuri Rubinov @ 6/5/2009 8:25:09 PM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 8:58:41 PM
RE: Universal docs viewer? Posted by Yuri Rubinov @ 6/5/2009 9:04:20 PM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 9:09:34 PM
RE: Universal docs viewer? Posted by Yuri Rubinov @ 6/5/2009 9:31:38 PM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 9:52:35 PM
RE: Universal docs viewer? Posted by Yuri Rubinov @ 6/5/2009 10:02:55 PM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/5/2009 10:13:14 PM
RE: Universal docs viewer? Posted by Yuri Rubinov @ 6/6/2009 3:58:27 AM
RE: Universal docs viewer? Posted by Ilya Rabyy @ 6/9/2009 4:59:04 PM
RE: Universal docs viewer? Posted by a modi @ 7/29/2009 4:25:52 PM
RE: Universal docs viewer? Posted by Yousfi Benameur @ 6/5/2009 10:26:01 PM
RE: Universal docs viewer? Posted by Biju Thomas @ 6/6/2009 6:43:33 AM