![]() |
#2
|
||||
|
||||
![]()
You could use code like:
Code:
Sub GetBookmarks() Application.ScreenUpdating = False Dim strFolder As String, strFile As String, wdDoc As Document Dim ArrBkMks As String, i As Long, StrBkMk As String, StrOut As String ArrBkMks = "Bookmark1,Bookmark2,Bookmark3" strFolder = GetFolder If strFolder = "" Then Exit Sub strFile = Dir(strFolder & "\*.doc", vbNormal) While strFile <> "" Set wdDoc = Documents.Open(FileName:=strFolder & "\" & strFile, AddToRecentFiles:=False, Visible:=False) With wdDoc StrOut = StrOut & .Name For i = 0 To UBound(Split(ArrBkMks, ",")) StrBkMk = Split(ArrBkMks, ",")(i) StrOut = StrOut & vbTab & StrBkMk & ": " If .Bookmarks.Exists(StrBkMk) Then StrOut = StrOut & .Bookmarks(StrBkMk).Range.Text End If Next i End With StrOut = StrOut & vbCr wdDoc.Close SaveChanges:=False strFile = Dir() Wend Set wdDoc = Nothing ActiveDocument.Range.InsertAfter StrOut Application.ScreenUpdating = True End Sub Function GetFolder() As String Dim oFolder As Object GetFolder = "" Set oFolder = CreateObject("Shell.Application").BrowseForFolder(0, "Choose a folder", 0) If (Not oFolder Is Nothing) Then GetFolder = oFolder.Items.Item.Path Set oFolder = Nothing End Function You'll get a list of the documents, the bookmarks and their contents exported to the active document.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
t-4-2 | PowerPoint | 2 | 01-19-2012 02:24 AM |
![]() |
anton | Excel | 1 | 12-20-2011 03:56 AM |
Extract Numbers from Zip Code | Karen615 | Excel | 3 | 09-21-2011 06:54 AM |
![]() |
mit | Excel | 1 | 06-14-2011 10:15 AM |
Links between files to bookmarks in PDF | spud098 | Word | 0 | 07-14-2010 01:11 AM |