Spire.Doc is a professional Word .NET library specifically designed for developers to create, read, write, convert and print Word document files. Get free and professional technical support for Spire.Doc for .NET, Java, Android, C++, Python.

Fri Feb 19, 2016 3:05 pm

Is it possible to determine if a bookmark exists before attempting to use the MoveToBookmark function within the BookmarkNavigator? Currently we are using a try catch block for this, but looking for a better way.

nseyler
 
Posts: 12
Joined: Wed Nov 04, 2015 6:43 pm

Mon Feb 22, 2016 2:50 am

Hi,

Thanks for your posting.
Please try the following solution to determine if bookmark exists.
Code: Select all
  Bookmark bookmark = doc.Bookmarks.FindByName("Test");
  if (bookmark != null)
 {
 }


Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Tue Feb 23, 2016 8:17 am

Hi,

Has your issue been resolved?
Thanks for your feedback.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Tue Mar 22, 2016 3:17 pm

yes this worked, thank you.

nseyler
 
Posts: 12
Joined: Wed Nov 04, 2015 6:43 pm

Wed Mar 23, 2016 1:24 am

Hi,

Thanks for your feedback.
I am glad that it helps. Welcome to write to us again if you have further problems.

Best Regards,
Amy
E-iceblue support team
User avatar

amy.zhao
 
Posts: 2767
Joined: Wed Jun 27, 2012 8:50 am

Return to Spire.Doc