| | |
Microsoft.Office.Interop.Word problem
Please support our C# advertiser: Programming Forums - DaniWeb Sister Site
![]() |
•
•
Join Date: Jan 2009
Posts: 68
Reputation:
Solved Threads: 0
Hi,
I'm getting the error at the doc.close in the last argument; type mismatch error
using object 11 com addin; for which the doc.close takes 3 arguments.
thx
I'm getting the error at the doc.close in the last argument; type mismatch error
using object 11 com addin; for which the doc.close takes 3 arguments.
thx
C# Syntax (Toggle Plain Text)
Microsoft.Office.Interop.Word.ApplicationClass wordApp = new ApplicationClass(); object file = textBox1.Text; object nullobj = System.Reflection.Missing.Value; Microsoft.Office.Interop.Word.Document doc = wordApp.Documents.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); doc.ActiveWindow.Selection.WholeStory(); doc.ActiveWindow.Selection.Copy(); IDataObject data = Clipboard.GetDataObject(); richTextBox1.Text = data.GetData(DataFormats.Text).ToString(); doc.Close(ref file, ref nullobj,ref nullobj);
I didn't try your code but have a look on http://msdn.microsoft.com/en-us/libr...a2(VS.80).aspx and if it raises an error reply again.
BI Developer | LINKdotNET
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
B.Sc Computer Science, Helwan University
Technical blog | http://ramymahrous.wordpress.com
LinkedIn | http://www.linkedin.com/in/ramymahrous
![]() |
Similar Threads
- Could not load file or assembly 'Microsoft.Office.Interop.Word (ASP.NET)
- Reading word file (C#)
- Word Automation Image save in jpg format (ASP.NET)
- Display word doc in vb.net (VB.NET)
- how to work with word document in asp.net (ASP.NET)
- open a new word document (ASP.NET)
Other Threads in the C# Forum
- Previous Thread: merging microsoft database with c#
- Next Thread: How to check for a %key in a keydown event handler?
Views: 1753 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for C#
.net access algorithm array barchart bitmap box button buttons c# chat check checkbox class client code color combobox control conversion csharp custom database datagridview dataset datetime degrees draganddrop drawing encryption enum excel file files form format forms ftp function gdi+ httpwebrequest image index input install java label list listbox listener login mandelbrot math mouseclick mysql networking object operator oracle path photoshop picturebox pixelinversion post prime programming radians regex remote remoting resource richtextbox save saving serialization server sleep socket sql statistics stream string table tcp text textbox thread time timer treeview update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






