Hello,
I have to programatically add rows to an user-defined word template. I would like to do with Aspose.Words the same exact operation as in Word: select row, copy, paste. This inserts a row with the same border styles and fonts.
I’ve tried using the Clone and InsertAfter methods, with no luck (cannot InsertAfter).
Dim DuplicatedRow As Node = DocBuild.CurrentStory.Tables(TableIdx).Rows(RowIdx).Clone(True)
DocBuild.CurrentStory.Tables(TableIdx).Rows(RowIdx).InsertAfter( DuplicatedRow , _
DocBuild.CurrentStory.Tables(TableIdx).Rows(RowIdx))
Can you show me how to accomplish that, or point me to the relevant API ?
Thanks,
Pascal.
Hi
Thanks for your inquiry. I think you should use the following code to achieve this.
Dim newRow As Row = CType(doc.FirstSection.Body.Tables(0).Rows(index).Clone(True), Row)
doc.FirstSection.Body.***Tables(0)*.**InsertAfter(newRow, doc.FirstSection.Body.Tables(0).Rows(index))
Or use the following code.
Dim index As Integer = 2
Dim newRow As Row = CType(doc.FirstSection.Body.Tables(0).Rows(index).Clone(True), Row)
doc.FirstSection.Body.Tables(0).Rows.Insert(index + 1, newRow)
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.
Sets consent for personalized advertising.
Cookie Notice
To provide you with the best experience, we use cookies for personalization, analytics, and ads. By using our site, you agree to our cookie policy.
More info
Enables storage, such as cookies, related to analytics.
Enables storage, such as cookies, related to advertising.
Sets consent for sending user data to Google for online advertising purposes.