Hello.
I'm using Aspose.Words dll version 8.0.0.0 and found an issue with bookmarks.
I've added several bookmarks using MS Word 2007: BM1, BM2, Bookmark3 and BM4. BM1 and Bookmark3 are placed closely. When I open bookmark list within MS word i can see all of them. But when I'm trying to enumerate them using Document.Range.Bookmarks collection BM1 occurs twice but Bookmark3 doesn't appear at all.
You can find test document with bookmarks in attachments.
I use next code block for enumeration:
public void Initialize(string filePath)
{
this.WordDocument = new Document(filePath);
BookmarkCollection bookmarkCollection = this.WordDocument.Range.Bookmarks;
string guidText = null;
foreach (Bookmark mark in bookmarkCollection)
{
guidText = Guid.NewGuid().ToString();
Console.WriteLine("Processing bookmark: {0} {1}", mark.Name, guidText);
mark.Text = mark.Name + guidText;
}
this.WordDocument.Save(@"d:\"+Guid.NewGuid().ToString("B")+".doc");
}
Thanks in advance.