473,785 Members | 2,221 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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

5 New Member
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 3056
GaryTexmo
1,501 Recognized Expert Top Contributor
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
2554
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 fpt://www.mysite.com/India i mapped these folders in virtual directory as http:/www.mysite.com/images and here i have folders for usa and india.
1
1563
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 images with an <img=..... I only get the direct path to the file-server. PS uploading the files works fine. But not dispalying them
1
3733
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 as a slide then i want to display these images as a slide show. How can i alot time teo each frame? How can i display images one by one without my interaction? Please give me the solution or any releated source code.
2
2385
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 images. Supplier image field only contains file name (ie, "a.gif"). How to bind this image to the report Thanks a lot in advance *** Sent via Developersdex http://www.developersdex.com ***
0
1332
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 dynamically loaded into DataList, but I am not able to display images in DataList , can u help me please to sort out the problem , OR it would be better if u give me source , as u said in the above Post .
5
5044
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 that calls the web service to render a vertical strip of images. After doing some research I am unable to find some vb.net code that can assist in what I want to achieve. The closest thing I found was
2
6846
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 to is to bind a combobox to this table so that the combobox will display these these five images in its dropdown list and the user can then select any of them. Depending on which image is selected, the combobox will display the image and I will...
2
2800
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 still getting used to .net I can successfully upload images and other data into the SQL Database, I'm currently storing RecordID, File Name, Type of File (mime), File Size, and File Data. I can retreive non binary data to a datagrid but I cannot...
14
3005
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 broken image placeholders. If i don't upload in sums of 5 then these broken image places holders keep showing, and instead of the images displaying row by row it goes by columns. Below is the code to display....can someone tell me where i've gone...
1
3029
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 go to next page, by default it returns to home page. I stored images in local directory and written for each loop to display images in table format. Without using mysql as backend. My question is how to display bunch of images in table formated...
0
9647
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
9489
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,...
1
10100
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8988
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
7509
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
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
4061
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
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.