returning descriptions of macros

L

Larry

In Word 97, is it possible to return the macro descriptions that appear
for each macro at the bottom of the Macros dialog box?

Larry
 
P

pieter

hi Larry,

if you know the name of the macro you can use
msgbox WordBasic.MacroDesc$("MyMacro")

if you don't know the name, use the Microsoft Visual Basic for Applications
Extensibility library to export the code to a text file and then read in the
..VB_Description attribute tag. this will also allow you to get descriptions
of private procedures, procedures with parameters and properties.

greetings, pieter.
 
L

Larry

Would it be possible to create a list of all macros and their
descriptions? Since the WordBasic that displays the description is a
different language from VBA, I'm not sure how I would proceed to print a
list using the "For Each" statement as I would with VBA for Word 97.

Thanks for any help,

Larry
 
L

Larry

Here's a sample macro from WordBasic help that prints a list of all
macros. How do I adjust this macro to make it work in Word 97?


For Count = 1 To CountMacros(0)
Name$ = MacroName$(Count, 0)
Bold 1
Insert Name$ + Chr$(9)
Bold 0
Insert MacroDesc$(Name$)
InsertPara
Next Count


Larry
 
W

Word Heretic

G'day "Larry" <[email protected]>,

prefix the WordBasic only commands with WordBasic.

eg

For Count = 1 To WordBasic.CountMacros(0)

Some commands aren't supported in l8r versions - if this is the case,
reply back and I'll give the modern equivalent - to a certain degree.

However, as WordBasic.MacroName$() is one of the ones that isnt
supported properly, its kinda irrelevant.



Larry said:
Here's a sample macro from WordBasic help that prints a list of all
macros. How do I adjust this macro to make it work in Word 97?


For Count = 1 To CountMacros(0)
Name$ = MacroName$(Count, 0)
Bold 1
Insert Name$ + Chr$(9)
Bold 0
Insert MacroDesc$(Name$)
InsertPara
Next Count


Larry

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email: (e-mail address removed)
Products: http://www.geocities.com/word_heretic/products.html
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.
 
L

Larry

I prefaced "CountMacros(0) with "WordBasic," but am not sure where to go
next. Can you explain in more detail what I need to do? As for
MacroNames$, whether I put "WordBasic" before it or not, I get an error
message.


For Count = 1 To WordBasic.CountMacros(0)
Name$ = MacroName$(Count, 0)
Bold 1
Insert Name$ + Chr$(9)
Bold 0
Insert WordBasic.MacroDesc$(Name$)
InsertPara
Next Count
 
W

Word Heretic

G'day "Larry" <[email protected]>,

<sighs> That's exactly what I said Larry. There is NO modern equiv to
this command. That having been said I am sure I bumped into some
cleverness hanging off www.mvps.org/word/FAQs/index.html somewhere
that does do what you want. Me? I would just scan each line of the
vbcomponents for suitable Public Sub / Functions to collect when
needed.

I was trying to say this:

Normally you just preface with WordBasic.

Sometimes this don't work.

MacroName$ is one of those areas where it dont work :)



Larry said:
I prefaced "CountMacros(0) with "WordBasic," but am not sure where to go
next. Can you explain in more detail what I need to do? As for
MacroNames$, whether I put "WordBasic" before it or not, I get an error
message.


For Count = 1 To WordBasic.CountMacros(0)
Name$ = MacroName$(Count, 0)
Bold 1
Insert Name$ + Chr$(9)
Bold 0
Insert WordBasic.MacroDesc$(Name$)
InsertPara
Next Count

Steve Hudson

Word Heretic, Sydney, Australia
Tricky stuff with Word or words for you.
Email: (e-mail address removed)
Products: http://www.geocities.com/word_heretic/products.html
Spellbooks: 728 pages of dump left and dropping...

The VBA Beginner's Spellbook: For all VBA users.
 

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