473,765 Members | 2,172 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Load word file and html file into richtextbox

HI Guys
How to open a word file and HTML file (Without tags) into
richtextbox control.file is opening by this code but it is opening in
plaintext format but i want to open in word format

IDataObject Data1;
object nullobj,file;
WordApp=new Word.Applicatio nClass();
nullobj=Missing .Value;
file =strFileName1;
WordDoc = WordApp.Documen ts.Open(ref file, ref nullobj, ref
nullobj, ref nullobj,ref nullobj, ref nullobj, ref nullobj, ref
nullobj,ref nullobj, ref nullobj, ref nullobj, ref nullobj,ref nullobj,
ref nullobj, ref nullobj,ref nullobj);
WordDoc.ActiveW indow.Selection .WholeStory();
WordDoc.ActiveW indow.Selection .Copy();
Data1= Clipboard.GetDa taObject();
str= Data1.GetData(D ataFormats.Stri ngFormat).ToStr ing();
richTextBox2.Te xt = str;
Console.WriteLi ne(str);
WordDoc.Close(r ef nullobj, ref nullobj, ref nullobj);

pla somebody help me.

Twinkle

Aug 11 '06 #1
2 17187
"Twinkle" wrote:
How to open a word file and HTML file (Without tags) into
richtextbox control.file is opening by this code but it is opening in
plaintext format but i want to open in word format
I believe you need to make changes to the following lines in your code:

str= Data1.GetData(D ataFormats.Rtf) .ToString();
richTextBox2.Rt f = str;

--
Timm Martin
Mini-Tools
..NET Components and Windows Software
http://www.mini-tools.com

Aug 11 '06 #2
Hi there
Thank you lot for help me
Twinkle
Mini-Tools Timm wrote:
"Twinkle" wrote:
How to open a word file and HTML file (Without tags) into
richtextbox control.file is opening by this code but it is opening in
plaintext format but i want to open in word format

I believe you need to make changes to the following lines in your code:

str= Data1.GetData(D ataFormats.Rtf) .ToString();
richTextBox2.Rt f = str;

--
Timm Martin
Mini-Tools
.NET Components and Windows Software
http://www.mini-tools.com
Aug 12 '06 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
7049
by: Dominic | last post by:
Hi guys, In .NET, how can I convert a HTML file to TIFF efficiently? One possible way is that I can first use word automatation to load the HTML up and then print it to TIFF. Is that right? However, even if it is technically feasible, it can take long time to do the conversion, especially the HTML is complicated. Is there any other more efficient way? Thanks!
5
7120
by: alejandro lapeyre | last post by:
How can I load / parse an HTML file with .NET? Thanks! Best regards, Alejandro Lapeyre
1
4719
by: Amit D.Shinde | last post by:
Can Microsoft Word Document(.Doc) be loaded in Rich Text Box. Or is there any other method to get preview of Microsoft Word Document in VB.NET Please Help me
9
2957
by: Jay Kim | last post by:
Hi, We're implementing a Windows application using Visual Basic .NET. One of the key features we need to implement is that we should be able to get the accurate byte offset of user selected text in the file. We've been trying to use the RichTextBox control to load
4
17722
by: ksskumar | last post by:
Hi Friends, I am creating a application using C#. In that application I am using RichTextBox (System.Windows.Forms.RichTextBox). My query is how to create a file link in Rich text box. Means, I want to embed file in Richtextbox. If the user click / doubleclick / Ctrl+click the link, that file should open. It is like hyperlink in HTML.
2
2175
by: Larry Cheung | last post by:
Hi, Is ther anyway I can present a html file on a win form? I have tried richtextbox. However, it can only accept text or richtext file format. I would like to use this feature to, for example, present a html email in a form, may allow user to some editing as well. Any help is higly appreciated!
3
8725
by: sss024 | last post by:
Word document viewing in RichTextBox control
1
1378
by: thomasp | last post by:
Using VB2005 I am trying to display a .rft file in a richtextbox control. The file contains an table and some other text. The file opens without a problem in MS Word, but when I display it in the richtextbox control, the text in the table is not in the correct columns. The text is shifted to the right and extends outside the table. Any Ideas Also, can the PrintPreview control be used to view the .rtf file? I have several reports...
7
1568
by: veer | last post by:
Hi! i am making a program in which i want to search a particular word in html file and if word found save it into excel file with html file name e.g i want to search a string "visual" in a.html file and if found then this string is transfered into excel file with html file name please give some idea thanks in advance varinder
0
9568
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9398
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8831
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7375
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5419
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3924
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3531
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2805
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.