VBA, Bookmarks, Word and Excel... help please!

D

danmasi

Greetings,

I'm a seasoned software person who's never touched VBA or any kind of
Microsoft application programming, and I find I have a problem I need
to solve quickly. I could probably muddle through books and bash my way
to a solution in a few days, but any pointers as to the right direction
would be GREATLY appreciated!

In short, I have a Word document with a few hundred bookmarks; each
bookmark highlights a bit of requirement text (actually, more than one
document, but I digress...)

I need to create an Excel sheet that has one row per requirement.
There needs to be a column that captures the bookmarked text from the
Word document, and another column with a hyperlink to that bookmark.

Again, I have yet to look at a single line of VBA code. Can anyone
point me towards the right objects, methods, etc.? I suppose I need to
iterate through a bookmark collection, extract the text, and add a row
to the spreadsheet.

Also, where would I actually code this... in the Excel application, or
the Word application (or does it matter)?

Thanks much for any pointers!

Dan Masi
 
T

Tom Ogilvy

Both Excel and Word have macro recorders. To get help with syntax, turn on
the macro recorder found under the tools=>Macros menu and perform the action
manually. (for example edit a bookmark).

Then turn it off and look at the recorded code. It will have thinks like
Object.select selection.Property = code because that is what you did
manually. Generally you can replace the select / selection pair and put the
property with the object.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top