//// This code is part of Document Solutions for Word demos.// Copyright (c) MESCIUS inc. All rights reserved.//usingGrapeCity.Documents.Word; namespaceDsWordWeb.Demos{// This example shows how to use ContentObject.CanAdd() method to test// whether a paragraph can be added to a content control.publicclassCanAddPara {publicGcWordDocumentCreateDocx() {var doc = newGcWordDocument();var p = doc.Body.Paragraphs.Add();var cc = p.AddContentControl(ContentControlType.RichText).Content;if (cc.CanAdd(typeof(Paragraph))) // returns false since the content control was created on inline level cc.AddParagraph("Paragraph added to Rich Text Content Control.");else cc.AddRun("Run added to Rich Text Content Control.");// Done:return doc; } }}