![]() You can add content control as a child to a paragraph using the inline content control. ![]() You can download a complete working sample from GitHub. FromFile ( "Image.png" )) 'Saves and closes the Word document instance document. AddParagraph, WParagraph ) 'Adds image to the paragraph paragraph. ResetCells ( 2, 3 ) 'Adds new paragraph to the block content control paragraph = CType ( blockContentControl. ![]() AddTable, WTable ) 'Specifies the total number of rows and columns table. AppendText ( "Block content control" ) 'Adds new table to the block content control Dim table As WTable = CType ( blockContentControl. AddParagraph, WParagraph ) 'Adds new text to the paragraph paragraph. RichText ), BlockContentControl ) 'Adds new paragraph in the block content control Dim paragraph As WParagraph = CType ( blockContentControl. AddBlockContentControl ( ContentControlType. Body 'Adds block content control into Word document Dim blockContentControl As BlockContentControl = CType ( textBody. AddSection Dim textBody As WTextBody = section. 'Creates a new Word document Dim document As WordDocument = New WordDocument 'Adds new section to the document Dim section As IWSection = document. FromFile ( "Image.png" )) //Saves and closes the Word document instance document. AddParagraph () as WParagraph //Adds image to the paragraph paragraph. ResetCells ( 2, 3 ) //Adds new paragraph to the block content control paragraph = blockContentControl. AddTable () as WTable //Specifies the total number of rows and columns table. AppendText ( "Block content control" ) //Adds new table to the block content control WTable table = blockContentControl. AddParagraph () as WParagraph //Adds new text to the paragraph paragraph. RichText ) as BlockContentControl //Adds new paragraph in the block content control WParagraph paragraph = blockContentControl. Body //Adds block content control into Word document BlockContentControl blockContentControl = textBody. AddSection () WTextBody textBody = section. Creates a new Word document WordDocument document = new WordDocument () //Adds new section to the document IWSection section = document. AppendPicture ( imageStream ) //Creates memory stream MemoryStream outputStream = new MemoryStream () //Saves and closes the Word document instance document. Read ) //Adds image to the paragraph paragraph. AddParagraph () as WParagraph //Gets the image stream FileStream imageStream = new FileStream (, FileMode. ![]()
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |