Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.worksheet.functions
external usenet poster
 
Posts: 12
Default Question about Word export to excel?

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


  #2   Report Post  
Posted to microsoft.public.excel.worksheet.functions
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



Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Paste Table from Word in Excel - 2000 -vs- 2002 PeteW Excel Discussion (Misc queries) 3 April 27th 06 07:36 AM
Extract MS Excel Data embedded in MS Word qualityprocess Excel Discussion (Misc queries) 0 April 20th 06 05:52 PM
can i export my excel page into a word doc? winfree Excel Discussion (Misc queries) 1 March 13th 06 07:49 PM
Excel 5 and Excel 2000 question. Naveen Mukkelli Excel Discussion (Misc queries) 1 March 3rd 06 10:05 AM
How do I export an Excel graph into a word document? jennyb Excel Discussion (Misc queries) 1 September 29th 05 05:48 PM


All times are GMT +1. The time now is 01:02 AM.

Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 ExcelBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Excel"