Reply
 
Thread Tools Display Modes
  #1   Report Post  
Beth Mc
 
Posts: n/a
Default 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   Report Post  
Jay Freedman
 
Posts: n/a
Default

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

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Can I print a list of fonts IN those fonts? Laura3521 Microsoft Word Help 5 April 28th 05 05:47 PM
How do I print a data source as a list? KAC Mailmerge 3 April 13th 05 09:21 AM
How do I print Mail merge recipients data list BarbaraJ Mailmerge 1 April 5th 05 02:20 PM
How to print a full sheet of labels for each person on a list Powell@BCC Mailmerge 2 March 25th 05 02:49 PM
How to I print out the mail merge list? stuartg123 Mailmerge 2 January 5th 05 04:42 AM


All times are GMT +1. The time now is 06:44 AM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"