Home |
Search |
Today's Posts |
#1
|
|||
|
|||
Print Macro bookmark list - to new doc
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 -- Thanks, Beth |
#2
|
|||
|
|||
Just remove the two lines
.PrintOut .Close wdDoNotSaveChanges That will leave the document on screen. If you want it to prompt you to save the document, put this line in the space where you took out the other two: .Save -- Regards, Jay Freedman Microsoft Word MVP FAQ: http://word.mvps.org Beth Mc wrote: 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 |
Reply |
Thread Tools | |
Display Modes | |
|
|
Similar Threads | ||||
Thread | Forum | |||
Can I print a list of fonts IN those fonts? | Microsoft Word Help | |||
How do I print a data source as a list? | Mailmerge | |||
How do I print Mail merge recipients data list | Mailmerge | |||
How to print a full sheet of labels for each person on a list | Mailmerge | |||
How to I print out the mail merge list? | Mailmerge |