Atlanta Custom Software Development 

 
   Search        Code/Page
 

User Login
Email

Password

 

Forgot the Password?
Services
» Web Development
» Maintenance
» Data Integration/BI
» Information Management
Programming
  Database
Automation
OS/Networking
Graphics
Links
Tools
» Regular Expr Tester
» Free Tools

Provide a free preview of Office Documents
[ All Languages » VB »  Windows]

Total Hit ( 1659)

Rate this article:     Poor     Excellent 

 Submit Your Question/Comment about this article

Rating


 


NOTE that this tip requires Windows 98, Windows 2000, Windows 95/NT 4.0 + Active Desktop. If your application must do a lot of work with Office documents, then chances are that you might need to provide a quick preview of them. I'm not talking about scrolling pages up and down as in Word or Excel but just a quick snapshot of the first page of document. In other words, the same functionality that the Windows shell makes available once you installed Active Desktop on Windows 95 or Windows NT 4.0 or switch to Web mode under newer operating systems.

Try selecting a Word document in the shell, in Web mode, and a preview of the document should appear in the right part of the shell view within Explorer. To say the truth, such a preview appears only if the document itself embeds a preview image. You can make sure of this by looking at the document's properties through the context menu. You'll find a special checkbox to embed or not a preview image of the document.

To display such a preview also in your own applications you have to exploit a system provided ActiveX control. After opening the VB Components dialog, pick up the Webvw 1.0 Type Library control. It comprises two components. The one we're interested in is ThumbCtl. It looks like an Image control and provides a DisplayFile method. It supports GIF, JPEG, WMF, BMP, HTML and Office documents as well (Word, Excel, PowerPoint). Here's the straightforward code to exploit its services:

Click here to copy the following block
Private Sub Command1_Click()
  ThumbCtl1.displayFile Text1.Text
End Sub


Submitted By : Nayan Patel  (Member Since : 5/26/2004 12:23:06 PM)

Job Description : He is the moderator of this site and currently working as an independent consultant. He works with VB.net/ASP.net, SQL Server and other MS technologies. He is MCSD.net, MCDBA and MCSE. In his free time he likes to watch funny movies and doing oil painting.
View all (893) submissions by this author  (Birth Date : 7/14/1981 )


Home   |  Comment   |  Contact Us   |  Privacy Policy   |  Terms & Conditions   |  BlogsZappySys

© 2008 BinaryWorld LLC. All rights reserved.