| | |
Microsoft.Office.Interop.Word problem
Please support our C# advertiser: Intel Parallel Studio Home
![]() |
•
•
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?
| Thread Tools | Search this Thread |
.net access ado.net algorithm array barchart bitmap box broadcast buttons c# cast check checkbox client color combobox control conversion csharp custom database datagrid datagridview dataset datetime degrees development draganddrop drawing encryption enum event excel file files form format forms function gdi+ httpwebrequest image index input install java label list listbox listener mailmerge mandelbrot math mouseclick mysql operator path photoshop picturebox pixelinversion post programming radians regex remote remoting richtextbox robot save saving serialization server sleep socket sockets sql sql-server statistics stream string stringformatting sun table tcp text textbox thread time timer update usercontrol validation view visualstudio webbrowser windows winforms wpf xml






