Wrox Programmer Forums
Go Back   Wrox Programmer Forums > Visual Basic > VB.NET 1.0 > VB.NET 2002/2003 Basics
| Search | Today's Posts | Mark Forums Read
VB.NET 2002/2003 Basics For coders who are new to Visual Basic, working in .NET versions 2002 or 2003 (1.0 and 1.1).
Welcome to the p2p.wrox.com Forums.

You are currently viewing the VB.NET 2002/2003 Basics 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
  #1 (permalink)  
Old February 18th, 2004, 03:51 PM
Friend of Wrox
Points: 2,876, Level: 22
Points: 2,876, Level: 22 Points: 2,876, Level: 22 Points: 2,876, Level: 22
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
Join Date: Jun 2003
Location: Denver, CO, USA.
Posts: 428
Thanks: 57
Thanked 2 Times in 2 Posts
Default Word to HTML Converter in VB.NET?

I am looking for sample code that will help me convert Word documents into HTML format. I'd hoped it would be as simple as loading a DOC file into the axBrowser and then saving, but as always, nothing's that easy in .NET. The DOC loads into the browser object, but I can't seem to reference it as an HTML document. When I try, I get "SPECIFIED CAST IS NOT VALID". I assume this means that it's not an HTML document and that's the problem. Here's the code which works fine when viewing a HTML document in the browser object:

Dim doc As mshtml.HTMLDocument

Dim strHTML As String

    doc = brsDocument.Document <-----GET ERROR HERE



    strHTML = doc.body.innerHTML

Loop Until Not (strHTML Is Nothing)

Any clues for me?

Similar Threads
Thread Thread Starter Forum Replies Last Post
VB.Net Word Automation deboe Pro Visual Basic 2005 0 November 26th, 2007 09:57 PM
Word Parsing - VB.net pauljohns353 VB.NET 0 February 20th, 2007 07:39 AM
formatting of a word document with vb.net krmilburn General .NET 0 April 18th, 2006 06:47 AM
VBA Word is very slow with vb.net preeti01 VB How-To 4 May 5th, 2005 05:01 AM
VB.net Currency Converter lgschulz VB.NET 3 July 28th, 2004 05:24 PM

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