|
//Creates a new Word document
WordDocument document = new WordDocument();
//Adds one section and one paragraph to the document
document.EnsureMinimal();
//Gets the last paragraph
WParagraph paragraph =document.LastParagraph;
//Adds text to the paragraph
paragraph.AppendText("A new text is added to the paragraph. ");
//Appends inline content control to the paragraph
InlineContentControl inlineContentControl = paragraph.AppendInlineContentControl(ContentControlType.RichText) as InlineContentControl;
WTextRange textRange = new WTextRange(document);
textRange.Text = "Inline content control ";
//Adds new text to the inline content control
inlineContentControl.ParagraphItems.Add(textRange);
//Saves and closes the Word document instance
document.Save("Sample.docx", FormatType.Docx);
document.Close(); |
|
//Creates a new Word document
WordDocument document = new WordDocument();
//Adds one section and one paragraph to the document
document.EnsureMinimal();
IWTable table=document.LastSection.AddTable();
//Specifies the total number of rows & columns
table.ResetCells(1, 2);
//Gets the last paragraph
WParagraph paragraph = table[0, 0].AddParagraph() as WParagraph;
//Adds text to the paragraph
paragraph.AppendText("A new text is added to the paragraph. ");
//Appends inline content control to the paragraph
InlineContentControl inlineContentControl = paragraph.AppendInlineContentControl(ContentControlType.RichText) as InlineContentControl;
WTextRange textRange = new WTextRange(document);
textRange.Text = "Inline content control ";
//Adds new text to the inline content control
inlineContentControl.ParagraphItems.Add(textRange);
//Saves and closes the Word document instance
document.Save("Sample.docx", FormatType.Docx);
document.Close(); |
Hi,
Are there still plans to implement this feature: https://www.syncfusion.com/feedback/3119/support-for-cell-row-and-group-content-controls ?
Is there a way to programmatically set the placeholder text of a content control using DocIO
I am aware that the ref to interop is a different kind of content control, but I am looking for a similar parameter on the DocIO content contr
Kind regards
|
blockContentControl.ContentControlProperties.Title = "Name"; blockContentControl.ContentControlProperties.Tag = "Name"; |
Please add it as a feature request. You already have a 'HasPlaceHolderText' method
for contentcontrols
, so I would think that exposing the
PlaceHolderText property with get/set should not be too difficult for syncfusion to add.
Of course - I understand there are many requests and resources are limited.
Kind regards,
NIels van Strien