Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Document Thumbnail/Preview
Message
From
30/09/2002 15:54:48
Mike Sue-Ping
Cambridge, Ontario, Canada
 
General information
Forum:
Visual FoxPro
Category:
Windows API functions
Miscellaneous
Thread ID:
00705305
Message ID:
00706108
Views:
18
Hi Alexander,

I tried to run you code below to preview a thumbnail of a Word document but VFP keeps crashing with:

"OLE error code 0x80020006:Unknown name."

I am running VFP7 under Window NT4. Any idea why this problem occurs for me?

TIA

Mike


>
>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.)
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform