how to change existing bookmarks in my doc document

Technical support for Spire.Doc

Moderator: iceblue support

how to change existing bookmarks in my doc document

Postby muscken » Tue Sep 28, 2010 9:24 am

hi all,
i'm tryng your sprite.doc library and my company is evaluating to buy it.
my purpose is to change text on differents predefined bookmarks in a doc document.
i'm tryng to do this, but the only fileds BookmarkEnd, BookmarkStart and Name could'nt help me.
how can i change text on an existing bookmark??
i can obtain easily my bookmarks finding them by name, but i can't do else.
thanks
dario
muscken
 
Posts: 2
Joined: Tue Sep 28, 2010 9:15 am

Re: how to change existing bookmarks in my doc document

Postby Flash » Wed Sep 29, 2010 1:45 pm

Thanks for your inquiry.
Please use following to change existing bookmarks.

Code: Select all
            //Create word document
            document = new Document();
            document.LoadFromFile(@"..\..\bookmark.doc");

            BookmarksNavigator bookmarkNavigator = new BookmarksNavigator(document1);
            bookmarkNavigator.MoveToBookmark("mybookmark");
            bookmarkNavigator.ReplaceBookmarkContent("new context", false);

            //Save doc file.
            document.SaveToFile(@"dear2.doc", FileFormat.Doc);

            //Launching the MS Word file.
            WordDocViewer(@"dear2.doc");


Regards
User avatar
Flash
 
Posts: 56
Joined: Thu Jun 29, 2006 2:34 pm

Re: how to change existing bookmarks in my doc document

Postby muscken » Wed Sep 29, 2010 2:17 pm

thanks it work!
there is a simple way to save doc documents in pdf format?
thanks
muscken
 
Posts: 2
Joined: Tue Sep 28, 2010 9:15 am

Re: how to change existing bookmarks in my doc document

Postby Flash » Wed Sep 29, 2010 3:57 pm

sorry for inconvenience
Saving doc documents in pdf format is not supported at the moment. We have added your requested feature to our plan.
Regards
User avatar
Flash
 
Posts: 56
Joined: Thu Jun 29, 2006 2:34 pm

Re: how to change existing bookmarks in my doc document

Postby Benjamin Du » Fri Nov 15, 2013 6:54 am

Hello,
Our Spire.Doc support saving doc documents in pdf format now. Welcome to download it (http://www.e-iceblue.com/Download/downl ... t-now.html) and refer to the code below.
Document doc = new Document();
doc.LoadFromFile(@"..\..\E-iceblue.docx", FileFormat.Docx);
doc.SaveToFile(@"..\..\Target PDF.pdf", FileFormat.PDF);
doc.Close();

Regards,
Benjamin
e-iceblue support team
User avatar
Benjamin Du
 
Posts: 83
Joined: Thu Jul 25, 2013 2:38 am


Return to Spire.Doc

Who is online

Users browsing this forum: No registered users and 0 guests