Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB 6 Visual Basic 6 > VB How-To
|
VB How-To Ask your "How do I do this with VB?" questions in this forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old October 7th, 2005, 04:15 AM
Registered User
 
Join Date: Oct 2005
Posts: 5
Thanks: 0
Thanked 0 Times in 0 Posts
Default error contents of olestream

Please help,

I have an OLE container on a form and I need to load the word document into the object through code. I have found code from a book in fact just for this:

Private Sub Command1_Click()
   Dim nFileNumber As Integer
   nFileNumber = FreeFile
   Open "c:\training certificate pieces.doc" For Binary #nFileNumber
   OLE1.SourceDoc = nFileNumber
   *OLE1.ReadFromFile nFileNumber
   Close #nFileNumber

End Sub

I copied this code right out of the book and I am getting a weird error on the line of code with the asterisk.....

Run-time error '31037'
System error &h800401c2(-2147221054). Contents of the OLESTREAM not in correct format.


geet





Similar Threads
Thread Thread Starter Forum Replies Last Post
missing contents parry JSP Basics 1 August 25th, 2008 03:03 PM
I don't understand for some contents... jay0715 BOOK: Ivor Horton's Beginning Visual C++ 2005 0 November 4th, 2007 07:39 AM
to print datagrid contents josna VB.NET 6 January 13th, 2006 12:02 AM
table of contents light BOOK: Professional Crystal Reports for VS.NET 0 March 9th, 2005 09:45 AM
PLEASE: getting contents from remote server. stalker Javascript 14 April 29th, 2004 05:06 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.