Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Export Bookmarks?
I have created 30 or so documents with at least 75 bookmarks in each. Is
there any way I can export a bookmark list (TXT) from each document? I need to compare bookmarks between documents and I'm hoping that I don't have to type them all out. |
#2
|
|||
|
|||
I, for one, have never seen a way to do this from within Word. There may be
some type of utility that will enable you to print a list, but I'm not aware of one. Continue to check back because the MVPs & others usually seem to come up with something. Good Luck |:) On 3/23/05 7:03 PM, in article , "CMK" wrote: I have created 30 or so documents with at least 75 bookmarks in each. Is there any way I can export a bookmark list (TXT) from each document? I need to compare bookmarks between documents and I'm hoping that I don't have to type them all out. -- |
#3
|
|||
|
|||
CMK was telling us:
CMK nous racontait que : I have created 30 or so documents with at least 75 bookmarks in each. Is there any way I can export a bookmark list (TXT) from each document? I need to compare bookmarks between documents and I'm hoping that I don't have to type them all out. You could try a little macro like this one: '_______________________________________ Sub TypeOutBookmarkList() Dim MyBkmk As Bookmark Dim MyList As String Dim DocList As Document Dim CurDocName As String With ActiveDocument If .Bookmarks.Count = 0 Then MsgBox "There are no bookmarks in this document." Exit Sub End If For Each MyBkmk In .Bookmarks MyList = MyList & MyBkmk.Name & Chr(13) Next CurDocName = .Name End With Set DocList = Documents.Add With DocList .Range.Text = "Here is the list of bookmarks in " _ & CurDocName & ":" & Chr(13) & Chr(13) & MyList .PrintOut .Close wdDoNotSaveChanges End With End Sub '_______________________________________ -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#4
|
|||
|
|||
What if I want this macro to list the bookmarks in a new blank doc instead of
printout? Thanks, Beth "Jean-Guy Marcil" wrote: CMK was telling us: CMK nous racontait que : I have created 30 or so documents with at least 75 bookmarks in each. Is there any way I can export a bookmark list (TXT) from each document? I need to compare bookmarks between documents and I'm hoping that I don't have to type them all out. You could try a little macro like this one: '_______________________________________ Sub TypeOutBookmarkList() Dim MyBkmk As Bookmark Dim MyList As String Dim DocList As Document Dim CurDocName As String With ActiveDocument If .Bookmarks.Count = 0 Then MsgBox "There are no bookmarks in this document." Exit Sub End If For Each MyBkmk In .Bookmarks MyList = MyList & MyBkmk.Name & Chr(13) Next CurDocName = .Name End With Set DocList = Documents.Add With DocList .Range.Text = "Here is the list of bookmarks in " _ & CurDocName & ":" & Chr(13) & Chr(13) & MyList .PrintOut .Close wdDoNotSaveChanges End With End Sub '_______________________________________ -- Salut! _______________________________________ Jean-Guy Marcil - Word MVP ISTOO Word MVP site: http://www.word.mvps.org |
#5
|
|||
|
|||
Quote:
The following macro shall enable you to extract bookmarks within a document to a new one. Create a new module and paste these codes: Sub ExtractBookmarksInMultiDoc() Dim objBookmark As Bookmark Dim objTable As Table Dim nRow As Integer Dim objDoc As Document, objNewDoc As Document Dim objParagraph As Paragraph Dim strFolder As String, strFile As String strFolder = InputBox("Enter folder path he ") strFile = Dir(strFolder & "*.docx", vbNormal) While strFile "" Set objDoc = Documents.Open(FileName:=strFolder & strFile) Set objDoc = ActiveDocument Set objNewDoc = Documents.Add Selection.TypeText Text:="Bookmarks in " & "'" & objDoc.Name & "'" Set objTable = Selection.Tables.Add(Range:=Selection.Range, numrows:=1, numcolumns:=3) objTable.Borders.Enable = True nRow = 1 For Each objParagraph In objNewDoc.Paragraphs If objParagraph.Range.Style = "Caption" Then objParagraph.Range.Delete End If Next objParagraph With objTable .Cell(1, 1).Range.Text = "Name" .Cell(1, 2).Range.Text = "Texts" .Cell(1, 3).Range.Text = "Page Number" For Each objBookmark In objDoc.Bookmarks objTable.Rows.Add nRow = nRow + 1 .Cell(nRow, 1).Range.Text = objBookmark.Name .Cell(nRow, 2).Range.Text = objBookmark.Range.Text .Cell(nRow, 3).Range.Text = objBookmark.Range.Information(wdActiveEndAdjustedP ageNumber) objDoc.Hyperlinks.Add Anchor:=.Cell(nRow, 3).Range, Address:=objDoc.Name, _ SubAddress:=objBookmark.Name, TextToDisplay:=.Cell(nRow, 3).Range.Text Next objBookmark End With objNewDoc.SaveAs2 FileName:=objDoc.Path & "\" & "Bookmarks in " & objDoc.Name objDoc.Close strFile = Dir() Wend End Sub This macro is for batch processing. Bookmarks will be arranged in a table in new document with bookmark texts and page numbers in link. You can follow the link to quickly jump to the bookmark location in main document. For more detailed information, you can refer to this article: https://www.datanumen.com/blogs/batc...word-document/ Hope that helps! ERS Last edited by ERS : April 25th 17 at 04:45 AM |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
View (displaying) bookmarks - Word 2003 | Microsoft Word Help | |||
Find & Replace Bookmarks | Microsoft Word Help | |||
Add bookmarks in header/footer | Microsoft Word Help | |||
Lock portion of the document after inserting bookmarks | Microsoft Word Help | |||
How to protect bookmarks | Microsoft Word Help |