|
-
Jan 8th, 2009, 10:59 AM
#1
Thread Starter
New Member
Word Document to HTML
Hi, I'm new to VB so go easy on me. I need to write some code that opens a Word Document and then either extracts the data so that a HTML document can be created or simply resaves it as an HTML document.
I've had a quick look around the net and tried adding an Object Reference to Microsoft Word Object X.0 Library to my Project. So that I could play around with things, but immediately It was telling me the following weren't defined.
Dim objWdApp As Word.Application
Dim objWdDoc As Word.Document
Dim objwdRange As Word.Range
Could anyone either explain what kind of thing I would need to do or link me to some useful tutorial.
Muchos Gracias
Last edited by alanio; Jan 8th, 2009 at 11:12 AM.
-
Jan 8th, 2009, 11:25 AM
#2
Re: Word Document to HTML
Try
vb.net Code:
Dim objWdApp As Word.Application = DirectCast(CreateObject("Word.Application"), Word.Application)
Dim objWdDoc As Word.Document = DirectCast(objwdApp.Documents, Word.Document)
-
Jan 8th, 2009, 12:00 PM
#3
Thread Starter
New Member
Re: Word Document to HTML
nope, same error. It's like it doesn't recognise them, or the reference didn't work
Type word.Application is not defined
Type word.Range is not defined
Type word.Document is not defined
-
Jan 8th, 2009, 01:18 PM
#4
Re: Word Document to HTML
It sounds like you do not have a reference set.
You did Project/Add Reference, clicked on the .COM tab, found Microsoft Word Library, selected it, and clicked OK, right?
-
Jan 9th, 2009, 04:11 AM
#5
Thread Starter
New Member
Re: Word Document to HTML
Yup. Before I do anything else, is this what I should be using to acheive what I want ? Ie Word to HTML
-
Jan 9th, 2009, 05:03 AM
#6
Re: Word Document to HTML
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 9th, 2009, 09:30 AM
#7
Thread Starter
New Member
Re: Word Document to HTML
Thanks that link looks useful
-
Jan 9th, 2009, 11:21 AM
#8
Re: Word Document to HTML
It should. I wrote it just for you but its a good topic for a FAQ so I posted it there.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum. 
Microsoft MVP 2006-2011
Office Development FAQ (C#, VB.NET, VB 6, VBA)
Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
If a post has helped you then Please Rate it! 
• Reps & Rating Posts • VS.NET on Vista • Multiple .NET Framework Versions • Office Primary Interop Assemblies • VB/Office Guru™ Word SpellChecker™.NET • VB/Office Guru™ Word SpellChecker™ VB6 • VB.NET Attributes Ex. • Outlook Global Address List • API Viewer utility • .NET API Viewer Utility •
System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6 
-
Jan 9th, 2009, 12:18 PM
#9
Thread Starter
New Member
Re: Word Document to HTML
Well, thankyou I do feel honoured.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|