Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: C# WPF VS2010 Word
Hi friends. I am creating an application which allows a user to open word within an C# application with WPF. Can you please help me with the code to open a word application within a group box. Thanks in advance.
Posted 6-Apr-11 21:50pm
Edited 6-Apr-11 22:23pm
CPallini335.8K
v2
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

Here is a way to open a word document :
 
Add a COM reference : Microsoft Office 12.0 Object Library

 
Then add the following namespace :
 
using Microsoft.Office;
using office = Microsoft.Office.Interop.Word;
 
And then in the code where you want to use, add this :
 
var wordApp = new office.Application();
Document document=wordApp.Documents.Open(//Specify the parameters)
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

I would simplify the problem by creating new Process.
Process.Start("winword.exe");
Opening word application within a group box is not a trivial task.
Regards
  Permalink  
Comments
aditya behara at 7-Apr-11 5:12am
   
Can you elaborate this topic? I am creating a WPF application. I an using tab control in my application. And under a particular tab there is group box where I want to display the word application. Can you please upload the code that will be more explanatory.
Ciumac Sergiu at 7-Apr-11 5:48am
   
Process.Start will start Microsoft Word as a separate application. If you like to embed the Word app into your WPF you would rather want to consult P/Invoke topic proposed by Tarun.K.S.
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 3

A good start is here Office Development in Visual Studio[^]
 
Perhaps here you can find what you need.
  Permalink  
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 484
1 Peter Leow 443
2 Sergey Alexandrovich Kryukov 288
3 Kornfeld Eliyahu Peter 270
4 Maciej Los 230


Advertise | Privacy | Mobile
Web03 | 2.8.150301.1 | Last Updated 7 Apr 2011
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100