> >
> > 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.zipDear 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