Click here to Skip to main content
15,917,795 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi there!
I´ve started a project and everything is working good so far. Now i want the program to open Word. That works fine too. But now i wanna put the Wordwindow inside a panel of the Winform. How can i do that? I tried it isMdiContainer but that does not work because the
C#
Word.Application()

is no Window and the panel has no propety "isMdiContainer". Please help!!

Secondly i watched a video on utube how i can replace something in Word or have Merge Field and put something in it. I tried but it doesnt work:
C#
foreach(Microsoft.Office.Interop.Word.Fields Field in document.Fields)
{
    if (Field.Code.Text.Contains("test"))
    {
        Field.Select();
        application.Selection.TypeText("Name")
    }
}

Word opens but the fields are not changed
I would be glad about help

Thank you
Posted
Comments
CHill60 13-May-14 5:08am    
Can't help with the second bit but for the first bit have a look at Embedding PowerPoint presentation player into a WPF application[^] - it's powerpoint but the article includes clues on how to embed word or excel.
If you've got a few dollars to spare you could have a look at http://www.ocxt.com/[^]

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900