Deleting ranges with DeleteBookmarkContent
Hello,
I’m facing
a problem when i try to delete properly a range delimited by a bookmark in a
word document.
I use the DeleteBookmarkContent method from a bookmarkNavigator instance.
The output
result seems visually correct (the specified range is deleted) but in details I
notice that some bookmarks (outside the range) are lost.
I attached
you a sample project with a word document (test.doc).
The test
document contains 2 main ranges delimited by 2 bookmarks (ptabA and ptabB).
Each main range
contains other bookmarks (tabA and tabB to enclose tables, tabA1Col1, tabA1Col2
…. to enclose cells).
After the DeleteBookmarkContent call on ptabA bookmark, you will notice that :
- tabA1
bookmark is preserved => it should have been deleted because it was inside the
range to delete
- ptabA2
bookmark is lost => it should have been preserved because it was outside the
range to delete
This is
only a sample doc, but I have hundred of doc templates containing this kind of
structure / range which I delete dynamically (with Word interop).
I’m not
able to explain this behavior and I didn’t find a way to resolve it.
Please,
could you give me a sample to get the right output result ?
I made another
test with same code and the test document converted to docx (test.docx).
Strangely
the ouput result is a bit different :
- ptabA2 bookmark is still lost
Could you also
explain me why the result is different depending on the doc / docx
version used ?
For now everything
worked well with the doc format and your library (I’m currently testing your
product) and didn’t plan to convert all my doc templates to docx.
Based on this behavior, should I reconsider this point ?
Best regards ,
Flo
Attachment: testDocIORange_cb4d6279.zip
At least could you confirm me the issue will be resolved on both formats ?
We regret for the inconvenience caused. Due to internal concerns we were unable to include these fixes in 2019 Volume 1 SP1 release. We will include this fix in our upcoming release 2019 Volume 2 release which is expected to be rolled out by end of June 2019.
Regards,
Mohanaselvam J
We regret for the inconvenience
We are glad to inform that we are in final stage of our 2019 Volume 2 release which is expected to be rolled out by end of this week and also this fix will be included in that release.
Regards,
Poorani Rajendran
Dim bknav As New BookmarksNavigator(a)
bknav.MoveToBookmark("liste")
Dim bk As DLS.Bookmark = bknav.CurrentBookmark
bknav.DeleteBookmarkContent(True)
a.Bookmarks.Remove(bk)
Attachment: sample_ce3d8956.zip
''Dim bknav As New BookmarksNavigator(a)
''bknav.MoveToBookmark("rangeTab1")
''bknav.DeleteBookmarkContent(False)
''a.Bookmarks.Remove(bknav.CurrentBookmark)
''bknav = New BookmarksNavigator(a)
''bknav.MoveToBookmark("rangeRangeTab1")
''bknav.DeleteBookmarkContent(False)
''a.Bookmarks.Remove(bknav.CurrentBookmark)
'' case 2
''Dim bknav As New BookmarksNavigator(a)
''bknav.MoveToBookmark("RangeRecoAC1")
''bknav.DeleteBookmarkContent(False)
''a.Bookmarks.Remove(bknav.CurrentBookmark)
''bknav = New BookmarksNavigator(a)
''bknav.MoveToBookmark("RangeRecoAC2")
''bknav.DeleteBookmarkContent(False)
''a.Bookmarks.Remove(bknav.CurrentBookmark)
Attachment: sample_4a9a20e8.zip
Thank you for your update.
|
Queries |
Details |
|
Regarding the issue (Updated on 7/31/2019) |
We have confirmed that the reported “Nested bookmark not deleted while deleting bookmark content in Word document” is an issue and we have logged a defect report. The fix for this issue will be included in our 2019 Volume 3 release which is expected to be available at the end of September, tentatively. |
|
Regarding the issue (Updated on 8/5/2019) |
We can reproduce that the bookmarks are removed improperly (both case 1 and case 2) while deleting bookmark content in the given Word document. We will validate on this and will provide you more details on 7th August 2019. |
Please let us know if you have any other questions.
Regards,
Mohanaselvam J
Thank you for your patience,
Regarding the issue bookmark are removed improperly (Updated on 8/5/2019):
We have confirmed that the reported “Bookmark not removed properly while resaving the Word document” is an issue and we have logged a defect report.
The fix for this issue will be included in our 2019 Volume 3 release which is expected to be available at the end of September, tentatively.
The status of this bug can be tracked through the below link:
https://www.syncfusion.com/feedback/8067/bookmark-not-removed-properly-while-open-and-save-the-word-document
Regarding “Nested bookmark not deleted while deleting bookmark content in Word document”:
The status of this bug can be tracked through the below link:
https://www.syncfusion.com/feedback/8000/nested-bookmark-is-not-deleted-properly-while-deleting-a-bookmark-content
Please let us know if you have any other questions.
Regards,
Poorani Rajendran
Hi,
Please, could you try to fix this problem globally. We sent
you several examples but it’s hard to describe every possible case.
I guess it's not an easy work for you, but the behavior should be
identical to MS Word one (even if the deleted range contains bookmarks that
start or end outside this range).
We use this delete range principle in many models to be able
to adjust the document content dynamically during the reporting process.
And since we can not update all our customers models, for
the moment we can not use your library to process these models.
So we really hope the next release would be the good one 😊
Best Regards,
Flo
Thank you for your valuable feedback, we will address your feedback with high priority and we will implement the fix in generic manner. The fix for this issue will be included in our 2019 Volume 3 release which is expected to be available at the end of September, tentatively.
Please let us know if you have any other questions.
Regards,
Poorani Rajendran
Thank you for your update.
We have not included the fix for Bookmark not removed properly while resaving the Word document in our latest 2019 Volume 3 Beta release (v17.3.0.9),
As we promised earlier, we will include this fix in our upcoming 2019 Volume 3 main release, which is expected to be available at October, 2019 tentatively.
Regards,
Poorani Rajendran
Attachment: matriceAmianteDTA_1ad15515.rar
Thank you for your update.
We can reproduce the reported problem while deleting bookmark content in Word document. We will validate on the reported problem and update you more details about this on 20th November, 2019.
Please let us know if you have any other questions.
Regards,
Poorani Rajendran
Thank you for your patience.
We have confirmed that the reported “NullReferenceException issue while deleting bookmark content in Word document” is a defect and the fix for the issue will be included in our upcoming 2019 Volume 4 main release, which is expected to be available at December, 2019.
Please let us know if you have any other questions.
Regards,
Suriya Balamurugan.
We regret for not including the fix “NullReferenceException issue while deleting bookmark content in Word document” in 2019 Volume 4 release as we have promised earlier.
We faced few stability related issues in our complete automation testing while moving this fix by the end of release. So, we have reverted this fix from our release version. We will include this fix in our upcoming release 2019 Volume 4 SP1 which is expected to be rolled out by end of January 2020.
Regards,
Suganya R
Hello,
Once again, we hope that you will succeed in correcting this
defect in a generic and definitive way because we have a lot of templates in
which we dynamically delete ranges, and the configuration / layout is never
exactly the same.
However, the need is always the same and quite simple because we never cross
bookmarks. By "crossing" we mean : [[...]......], which is a very complex and twisted case.
Excluding this case, deleting a range delimited by a bookmark should never result in the
deletion of an object that is « visually » outside this range (especially
bookmarks, even if they start or end at the edge of the deleted range). We know
that your library doesn’t work like Word Automation, but we need the behavior /
result to be exactly the same on this point.
Please, notice that the problem has been reported a year ago
and we are still waiting for the fix to use your library in production.
Best regards,
Flo
We regret for the inconvenience caused.
Thank you for your valuable feedback, we will address your feedback with high priority and we will implement the fix in generic manner for all possible combinations in bookmark as much as possible. The fix for the issues will be included in our upcoming release 2019 Volume 4 SP1 which is expected to be rolled out by end of January 2020.
Regards,
Suriya Balamurugan.
- 23 Replies
- 10 Participants
-
FL Florider
- Jan 24, 2019 10:58 AM UTC
- Jan 2, 2020 01:46 PM UTC