View Single Post
  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
Chip Pearson Chip Pearson is offline
external usenet poster
 
Posts: 7,247
Default Question about Word export to excel?

In the VBA Editor, go to the Tools menu, choose References, and
select Microsoft Word. Then use code like the following:

Dim WordApp As Word.Application
Dim WordDoc As Word.Document
Dim Rng As Excel.Range
Dim BM As Word.Bookmark


Set Rng = Range("A1")
On Error Resume Next
Set WordApp = GetObject(, "Word.Application")
If WordApp Is Nothing Then
Set WordApp = CreateObject("Word.Application")
End If
If WordApp Is Nothing Then
MsgBox "Unable to access Word"
Exit Sub
End If

Set WordDoc = WordApp.Documents.Open(Filename:="H:\Test.doc")
'<<< CHANGE
For Each BM In WordDoc.Bookmarks
Rng.Value = BM.Name
Set Rng = Rng(2, 1)
Next BM



--
Cordially,
Chip Pearson
Microsoft MVP - Excel
Pearson Software Consulting, LLC
www.cpearson.com



"Mr BT" wrote in message
news:z0tug.190415$iF6.35041@pd7tw2no...
I cannot find a newsgroup for Word, it this might be applicable
to what is covered in this newsgroup so I'm going to ask this
anyways...

Is there a way i can export the list of Bookmarks from a Word
file ?

thx
Mr BT