473,385 Members | 1,798 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

How to display the images and shapes of .doc file in richtextbox of C#?

i have searched the code to display the .doc file in RichTextBox in c#.....
the code works but it shows only the text in RichTextBox not the images or shapes which are in that .doc file....
Is there any way to show the images and shapes of doc file in RichTextBox plezzz let me know....

i m sending u the code along with it if there is any change in it plezzz tell....

Expand|Select|Wrap|Line Numbers
  1.  
  2. IDataObject Data1;
  3.  
  4. object nullobj, file;
  5.  
  6. ApplicationClass WordApp = new ApplicationClass();
  7.  
  8. nullobj = System.Reflection.Missing.Value;
  9.  
  10. file = OFD_Text.FileName;
  11.  
  12. Document WordDoc = WordApp.Documents.Open(ref file, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref
  13. nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj, ref nullobj);
  14. WordDoc.ActiveWindow.Selection.WholeStory();
  15. WordDoc.ActiveWindow.Selection.Copy();
  16.  
  17. Data1 = Clipboard.GetDataObject();
  18.  
  19. string str = Data1.GetData(DataFormats.StringFormat).ToString() ;
  20.  
  21. richTextBox.Text = str;
  22.  
  23. WordDoc.Close(ref nullobj, ref nullobj, ref nullobj); 
  24.  
  25.  
Feb 25 '11 #1
1 3040
GaryTexmo
1,501 Expert 1GB
A RichTextBox control doesn't display images and shapes. If you want it to do this, you'll have to create your own control. You could try inheriting from a RichTextBox and adding your own logic to draw the shapes/images. You might have to come up with your own way to put the code for those things into your control somehow.

You could also google around and see what's available, such as....
http://www.anupshinde.com/Articles/WordInDotnet/
http://www.codeproject.com/KB/miscct...rdcontrol.aspx
Feb 25 '11 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

0
by: rehan | last post by:
i have iis5. windows 2k advance server. I have many http sites on iis. One ftp site with folders protected with userid and password. e.g i have folders at ftp://www.mysite.com/usa...
1
by: staleb | last post by:
Hi My problem is like this: I have a file-server and a web-server. How do I display images that r stored on the file-server. The users only have dircet access to web-server. When I display the...
1
by: Mamatha | last post by:
Hi I am developing a small application to capture a record a video file through webcam in C#.NET. In this application i created a JPEG images for every slide,means every JPEG image was treated...
2
by: TaeHo Yoo | last post by:
Would anyone be able to tell me how to display images dynomically from the database? I am using dataset which contains supplier name and supplier images. I can display supplier name but supplier...
0
by: Jameel | last post by:
I am facing 2 problems: 1. I have files uploaded to the server and have the relevant information in database, and now I want to pull the image name and path from database and have the images...
5
by: Peter Lapic | last post by:
I have to create a image web service that when it receives an imageid parameter it will return a gif image from a file that has been stored on the server. The client will be an asp.net web page...
2
by: Randy | last post by:
Hi, I have a small table - 2 columns, 5 rows. Col 1 is the key column and has integer values of 1 through 5. Column 2 is a varbinary(MAX) column and has jpg images loaded in it. What I want...
2
by: pozze | last post by:
Hi, I need to display images and other record information retrieved from an SQL 2005 database in a datagrid on a web page. I'm coding in VB .net I have recently changed over from VB ASP and i'm...
14
anfetienne
by: anfetienne | last post by:
Hi, i went through a tutorial on how to display images stored with a directory and it came out good but i have a problem.....when i upload less than 5 files it displays the 1 image and then shows...
1
by: harish81 | last post by:
Hi, Please help me to get images in table format. I'm new to PHP. I have written code to display images in a table format and it displays only 9 images in a single page. when i click Next Url to...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
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,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...

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.