Word.Application myWordApp = new Word.Application(); object missing = System.Reflection.Missing.Value; object oTemplate = strWordDoc; Word.Document document = myWordApp.Documents.Add(ref oTemplate, ref missing, ref missing, ref missing); foreach (Word.ContentControl contentControl in document.ContentControls) { contentControl.SetPlaceholderText(null, null,"Trial"); } myWordApp.ActiveWindow.ActivePane.View.Type = Word.WdViewType.wdPrintView; myWordApp.Visible = true; object index = 1; document.Windows.get_Item(ref index).View.Type = Word.WdViewType.wdPrintView;
foreach (Word.ContentControl contentControl in document.ContentControls) { contentControl.Range.Text="Trial"; contentControl.Delete(false); }
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)