>PUBLIC oForm1 >oForm1 = NewObject("thumb") >oForm1.Show >RETURN > >DEFINE CLASS thumb AS form > Height = 277 > Width = 361 > DoCreate = .T. > AutoCenter = .T. > Caption = "Thumbnail Preview" > Name = "Form1" > > ADD OBJECT command1 AS commandbutton WITH ; > Top = 240, ; > Left = 276, ; > Height = 25, ; > Width = 73, ; > Caption = "Select", ; > Name = "Command1" > > ADD OBJECT olecontrol1 AS olecontrol WITH ; > Top = 12, ; > Left = 12, ; > Height = 252, ; > Width = 252, ; > OleClass = "Shell.Explorer.2" > Name = "Olecontrol1" > > PROCEDURE Init > ThisForm.olecontrol1.navigate2("d:\thumb.htm") > ENDPROC > > PROCEDURE command1.Click > Local lcFile > lcFile = GetFile("*", "Select", "Preview", 0, "Select a file for preview") > ThisForm.olecontrol1.document.all.Thumbnail.DisplayFile(lcFile) > ENDPROC > > PROCEDURE olecontrol1.Refresh > *** ActiveX Control Method *** > NoDefault > ENDPROC > >ENDDEFINE >>where thumb.htm file looks like this:
><!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> ><HTML><HEAD> ><META http-equiv=Content-Type content="text/html; charset=unicode"> ><META content="MSHTML 6.00.2600.0" name=GENERATOR></HEAD> ><BODY> ><OBJECT id=ThumbCtl1 style="LEFT: 0px; TOP: 0px" >classid=clsid:71650000-E8A8-11D2-9652-00C04FC30871 name=Thumbnail></OBJECT> ></BODY></HTML> >>Notice that Office documents can be previewed only if they've been saved with an embedded preview picture. (There is a checkbox in the Properties dialog.)