Display image:
Copy codeThe Code is as follows: Image img = Image. FromFile (@ "E: \ image \ bottle \ 2006122013203825344.jpg ");
Clipboard. SetDataObject (img );
RichTextBox. Paste (DataFormats. GetFormat (DataFormats. Bitmap ));
Show word
String filename = @ "d: \ subf.doc ";
// C # reading word file instantiation COM
Microsoft. Office. Interop. Word. ApplicationClass wordApp = new Microsoft. Office. Interop. Word. ApplicationClass ();
Object fileobj = filename;
Object nullobj = System. Reflection. Missing. Value; // open the specified file. (The number of COM parameters varies in different versions. Generally, nullobj is used except the first one)
Microsoft. office. interop. word. document doc = wordApp. documents. open (ref fileobj, ref nullobj, ref upload, ref nullobj, ref nullobj, ref nullobj, ref nullobj); // obtain the text in the doc file.
ResponseFormsMediator. RemindersRichTextBox. Text + = doc. Content. Text; // C # Read the closed word file
Doc. Close (ref nullobj, ref nullobj, ref nullobj); // C # Close COM wordApp. Quit (ref nullobj, ref nullobj, ref nullobj) to read the word file );