|
-
Mar 2nd, 2006, 09:51 AM
#1
Thread Starter
Junior Member
how to open word(microsoft word) to richtextbox in vb.net?
how to open word(microsoft word) to richtextbox in vb.net? i just know use vb.net to open word but cannot import to richtextbox
-
Mar 2nd, 2006, 10:00 AM
#2
Re: how to open word(microsoft word) to richtextbox in vb.net?
A RichTextBox only can show plain text and RichText. A Word document is a word document, not a richtext document so you can't open a Word document inside of a RichTextBox unless you convert it to Rtf first.
If you are dead set on getting a word document to work in a richtextbox, you're probably going to have to create your own RichTextBox (inheriting the System.Windows.Forms.RichTextBox) and then read in the Word document, do your own parsing and convert it to Rtf. You won't be able to show all of the advanced features that way.
It's either that or you're creating your own TextBox from scratch and drawing everything. Again, you'd need to parse the Word Document.
-
Mar 3rd, 2006, 12:48 PM
#3
Thread Starter
Junior Member
Re: how to open word(microsoft word) to richtextbox in vb.net?
How Word document convert it to Rtf?
-
Mar 3rd, 2006, 12:59 PM
#4
Re: how to open word(microsoft word) to richtextbox in vb.net?
Do a .SaveAs and pass the parameter rtf parameter.
VB Code:
'...
'...
oDoc.SaveAs(FileName:="C:\Test.rtf", FileFormat:=Microsoft.Office.Interop.Word.WdSaveFormat.wdFormatRTF)
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 
-
Mar 3rd, 2006, 01:10 PM
#5
Re: how to open word(microsoft word) to richtextbox in vb.net?
 Originally Posted by BradleyOng83
How Word document convert it to Rtf?
Well, you have two options. Save it as an Rtf from within Word (As RobDog's code does), or you do some heavy research into the Doc format and write your own parser to parse it and then save as an Rtf. The former is easy but the user has to have Word on their machine. The latter is very difficult but you wouldn't need Word.
-
Mar 3rd, 2006, 01:22 PM
#6
Re: how to open word(microsoft word) to richtextbox in vb.net?
Since its a proprietary fileformat, I doubt you will be able to parse it without having Word installed on the system. So since you need Word, might as well take advantage of it.
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 
-
Mar 3rd, 2006, 01:44 PM
#7
Re: how to open word(microsoft word) to richtextbox in vb.net?
 Originally Posted by RobDog888
Since its a proprietary fileformat, I doubt you will be able to parse it without having Word installed on the system. So since you need Word, might as well take advantage of it. 
It's proprietary but that doesn't mean Word has to be installed. No part of any Document is saved to the Word program, therefore the Word Document has everything needed. You just have to find a way to figure out what every part means with little to no documentation. You can build your own Parser.
OpenOffice.org and KOffice both can read Word documents. They run on Linux so they definately don't require Word to be installed.
So while it is an option to parse a Word document and display it without Word, it's incredibly difficult. OpenOffice has tons and tons of developers in IBM, Sun, and regular OO developers. It's definitely a huge task for one person.
-
Mar 3rd, 2006, 02:00 PM
#8
Re: how to open word(microsoft word) to richtextbox in vb.net?
True, but thats why it wouldnt be a real solution as I wouldnt want to even try it. I dont have that kind of time left in my life. 
Ps, you need to update your avatar from vBulletin 2.0 to 3.0
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 
-
Mar 3rd, 2006, 02:03 PM
#9
Re: how to open word(microsoft word) to richtextbox in vb.net?
 Originally Posted by RobDog888
True, but thats why it wouldnt be a real solution as I wouldnt want to even try it. I dont have that kind of time left in my life. 
Hey! It's a real solution
Though it isn't practical at all.
 Originally Posted by RobDog888
Ps, you need to update your avatar from vBulletin 2.0 to 3.0 
But vBull 3 doesn't have an image. It's just text
Though in my preferences I told it to reference the URL for the LogOut button and didn't upload it myself (or at least I thought I did).
-
Mar 3rd, 2006, 02:34 PM
#10
Re: how to open word(microsoft word) to richtextbox in vb.net?
why not use the dsoframer.ocx and use it's read/write doc files methods in conjunction with the richtextbox
microsoft word's interface is one big glorified richtextbox...
-
Mar 3rd, 2006, 02:36 PM
#11
Re: how to open word(microsoft word) to richtextbox in vb.net?
Is the "dsoframer.ocx" a third party control or a MS one? Also, is it free?
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 
-
Mar 4th, 2006, 12:55 AM
#12
Re: how to open word(microsoft word) to richtextbox in vb.net?
 Originally Posted by RobDog888
Is the "dsoframer.ocx" a third party control or a MS one? Also, is it free?
yes and yes
i'll upload it for ya here cause i dont have a link to it on MS's site
Last edited by JuggaloBrotha; Jun 30th, 2010 at 03:00 PM.
-
Mar 4th, 2006, 01:08 AM
#13
Re: how to open word(microsoft word) to richtextbox in vb.net?
 Originally Posted by JuggaloBrotha
yes and yes
i'll upload it for ya here cause i dont have a link to it on MS's site
So I take it it's an MS control (the first question wasn't a yes or no so it's hard to tell what you were saying yes to)?
-
Mar 4th, 2006, 01:13 AM
#14
Re: how to open word(microsoft word) to richtextbox in vb.net?
If you check its properties you can see its "UNSUPPORTED BY MICROSOFT" and also signed by Microsoft. So its probably a Beta and/or free. I'll look if its still available as it was signed ~ a year ago.
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 
-
Mar 4th, 2006, 01:17 AM
#15
Re: how to open word(microsoft word) to richtextbox in vb.net?
Its True. but only supports Office 2000 and 2002 (XP).
Here is the link to it. Its a VC++ ocx for use in Visual Basic but doesnt say if its .NET or VB6. It does mention C# so maybe...
http://support.microsoft.com/default...b;en-us;311765
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 
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
|