Create New Word Document
object oMissing = System.Reflection.Missing.Value;
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
oDoc = oWord.Documents.Add(ref oMissing, ref oMissing,
ref oMissing, ref oMissing);
Open Word Document
object oMissing = System.Reflection.Missing.Value;
Word._Application oWord;
Word._Document oDoc;
oWord = new Word.Application();
oWord.Visible = true;
object fileName = @?E:\CCCXCXX\TestDoc.doc?;
oDoc = oWord.Documents.Open(ref fileName,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing,
ref oMissing, ref oMissing, ref oMissing, ref oMissing, ref oMissing);
More operations about C# Word can be found here;
http://stephenchy520.blog.com/2011/0...ms-word-via-c/
> On Sunday, November 25, 2007 6:23 AM lsg wrote:
> Hi,
> Is there any possibility to write an application i C# to open a MS Word
> document (doc, docx), find any form fields and fill them, save and print
> modified (filled) document without Word installed? Or make that
> application works with Word 2k, XP, 2003 version?
>> On Sunday, November 25, 2007 9:18 AM Nicholas Paldino [.NET/C# MVP] wrote:
>> Yes, but given that you want to span all of those versions, it will be
>> slightly difficult.
>>
>> The reason is because microsoft only had primary interop assemblies for
>> versions of office back to XP. Because of this, you will have to create an
>> interop assembly to make the calls to Word 2k yourself.
>>
>> Or, you could make all the calls late bound, through reflection,
>> although you might take a performance hit by doing so. However, it would
>> simplify making the same calls across different versions (assuming the
>> parameter signatures of the methods you are calling are the same).
>>
>> --
>> - Nicholas Paldino [.NET/C# MVP]
>> - (E-Mail Removed)
>>
>> "lsg" <(E-Mail Removed)> wrote in message
>> news:fiblvf$kor$(E-Mail Removed)...
>>> On Sunday, November 25, 2007 7:43 PM Mark Rae [MVP] wrote:
>>> Aspose can do this:
>>> http://www.aspose.com/Products/Aspos...s/Default.aspx
>>>
>>>
>>> --
>>> Mark Rae
>>> ASP.NET MVP
>>> http://www.markrae.net