Autogenerated Acronyms List?

G

Guest

Fellow Forum Members,
I'm using WORD 2003 for a 500 page Technical Manual and I'm wondering what
is the best way to develop an Acronym List while I write the manual? Is
there some way to tag each acronym as I create it and then autogenerate a
LIST OF ACRONYMS by pulling together all of the tagged acronyms into a table?
Even better, it would be cool if the acronym definition will also get pulled
as part of a different tag for placement in a separate table column. Any
ideas will be appreciated.
 
G

Graham Mayor

'Autogenerated' is asking a lot, but you can easily copy selected Acronyms
to a table for later creation into a list with a simple macro.
Create a two column/one row empty table. Put the cursor below the table and
save it. Substitute the name and path for the filename in the following
macro.

Sub SaveAcronyms()
On Error GoTo oops
Selection.copy
Documents.Open _
FileName:="""D:\My Documents\Acronym List.doc"""
With Selection
.EndKey Unit:=wdStory
.MoveUp Unit:=wdLine, Count:=1
.Paste
.MoveRight Unit:=wdCell, Count:=2
.MoveDown Unit:=wdLine, Count:=1
End With
ActiveDocument.Close SaveChanges:=wdSaveChanges
Exit Sub
oops:
MsgBox "Copy text first!"
End Sub

Select the acronym and run the macro (attached to a shortcut key combination
would be good) and it will be added to the next row of the table.
http://www.gmayor.com/installing_macro.htm

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Graham,
Thanks for the Macro. I tried it out and I'm amazed with what you have done.
It's an elegant solution for keeping an Acronym List in parallel with the
process of writing a technical manual. However, I'm kind of confused about
something. You instructed me to create a table with two columns. Currently,
the macro is only plugging in data into one column.

So for example I have the following acronym to apply your macro on:

" World Wide Web (WWW) "

Ideally, highlighting the entire line of text and then running the macro
should plugin " WWW " in column 1 and " World Wide Web " in column 2. Is
this to complicated to make happen? Is there some way to make the Macro
recognize the paranthesis " ( ) " symbols as data that needs to be plugged
into column 1? I'm curious to know what you think. Again, thanks for the
macro.
 
G

Graham Mayor

The macro was intended to to use only one column with the other column
reserved for your description as apepared to be the case from your original
request. the change your require is fairly straightforward - how about:

Sub SaveAcronyms()
Dim sAcronym As String
Dim sFirst As String
Dim sSecond As String
Dim intPos As Integer
On Error GoTo oops
sAcronym = Selection.Range
intPos = InStr(sAcronym, "(")
sFirst = Left(sAcronym, Len(sAcronym) - (Len(sAcronym) - (intPos - 2)))
sLast = Mid(sAcronym, intPos + 1, Len(sAcronym) - (intPos + 1))
Documents.Open _
FileName:="""D:\My Documents\Acronym List.doc"""
With Selection
.EndKey Unit:=wdStory
.MoveUp Unit:=wdLine, Count:=1
.TypeText Text:=sFirst
.MoveRight Unit:=wdCell
.TypeText Text:=sLast
.MoveRight Unit:=wdCell
.MoveDown Unit:=wdLine, Count:=1
End With
ActiveDocument.Close SaveChanges:=wdSaveChanges
Exit Sub
oops:
MsgBox "Copy text first!"
End Sub

This should work with the same table document (change the name and path as
before) select only the text eg
World Wide Web (WWW) (and not the macro). If you want to swap the columns
then swap the two TypeText lines around.

--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
G

Guest

Graham,
Your macro is amazing! It's going to facilitate the task of compiling an
Acronym List tremendously. However, for some reason the macro is not dropping
the RIGHT side paranthesis ")" when it plugs in the acronym in column 2. It
shows as "WWW)". The LEFT one however is being dropped by the Macro. To me
it's no big problem because I can easily eliminate this unwanted paranthesis
by using a Find and Replace operation. Again, thanks a lot for the macro.
 
G

Graham Mayor

It appears you are selecting the space after the right bracket when
selecting the text to process. If you habitually do this, change the sLast
line as follows.

sLast = Mid(sAcronym, intPos + 1, Len(sAcronym) - (intPos + 2))


--
<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
Graham Mayor - Word MVP

My web site www.gmayor.com

<>>< ><<> ><<> <>>< ><<> <>>< <>><<>
 
A

Al

Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.
 
G

Guest

Graham, thanks for the updates to your macro. With the changes you told me to
make I got your macro working exactly the way I want to work. Thanks again
mate.

Al, thanks for your post. I will keep your Find/Replace operation in mind.
 
G

Guest

Graham, thanks for the help with your macro. It now works exactly the way I
need it to work. Thanks again mate.

Al, thanks for your post. I will keep your Find / Replace operation in mind.
 
G

Guest

Graham, thanks for the help with your macro. It now works exactly the way I
need it to work. Thanks again mate.

Al, thanks for your post. I will keep your Find / Replace operation in mind.
 
G

Guest

I'm not sure how to do this. How do you add a unique style as stated in the
4th line?


Al said:
Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.


'Autogenerated' is asking a lot, but you can easily copy selected
Acronyms to a table for later creation into a list with a simple
macro. Create a two column/one row empty table. Put the cursor below
the table and save it. Substitute the name and path for the filename
in the following macro.
 
J

Jay Freedman

In the Replace dialog, click the More button to display the bottom
half. Click in the Replace With box, then click the Format button and
choose Style from the menu. In the Style dialog, choose some style (Al
suggested Body Text 2) that isn't used anywhere else in the document,
and click OK. The text below the Replace With box will now show the
style you chose, and it will be applied to each find.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I'm not sure how to do this. How do you add a unique style as stated in the
4th line?


Al said:
Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.


'Autogenerated' is asking a lot, but you can easily copy selected
Acronyms to a table for later creation into a list with a simple
macro. Create a two column/one row empty table. Put the cursor below
the table and save it. Substitute the name and path for the filename
in the following macro.
 
G

Guest

Reports that 0 found. Is this because they are in my dictionary?

Jay Freedman said:
In the Replace dialog, click the More button to display the bottom
half. Click in the Replace With box, then click the Format button and
choose Style from the menu. In the Style dialog, choose some style (Al
suggested Body Text 2) that isn't used anywhere else in the document,
and click OK. The text below the Replace With box will now show the
style you chose, and it will be applied to each find.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I'm not sure how to do this. How do you add a unique style as stated in the
4th line?


Al said:
Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.



'Autogenerated' is asking a lot, but you can easily copy selected
Acronyms to a table for later creation into a list with a simple
macro. Create a two column/one row empty table. Put the cursor below
the table and save it. Substitute the name and path for the filename
in the following macro.
 
J

Jay Freedman

No, finding and replacing has nothing at all to do with what's in your
dictionary.

I think you missed or misinterpreted Al's reference to doing a
"wildcard" search. That means that after you click the More button,
you need to check the box in the lower left that says "Use wildcards".
That's in addition to all the other things you need to set up in the
dialog.

For more about wildcard searches, see
http://www.gmayor.com/replace_using_wildcards.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Reports that 0 found. Is this because they are in my dictionary?

Jay Freedman said:
In the Replace dialog, click the More button to display the bottom
half. Click in the Replace With box, then click the Format button and
choose Style from the menu. In the Style dialog, choose some style (Al
suggested Body Text 2) that isn't used anywhere else in the document,
and click OK. The text below the Replace With box will now show the
style you chose, and it will be applied to each find.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

I'm not sure how to do this. How do you add a unique style as stated in the
4th line?


:

Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.



'Autogenerated' is asking a lot, but you can easily copy selected
Acronyms to a table for later creation into a list with a simple
macro. Create a two column/one row empty table. Put the cursor below
the table and save it. Substitute the name and path for the filename
in the following macro.
 
G

Guest

Still finding none. Guess its back to find and copy. Thanks for your efforts.

Jay Freedman said:
No, finding and replacing has nothing at all to do with what's in your
dictionary.

I think you missed or misinterpreted Al's reference to doing a
"wildcard" search. That means that after you click the More button,
you need to check the box in the lower left that says "Use wildcards".
That's in addition to all the other things you need to set up in the
dialog.

For more about wildcard searches, see
http://www.gmayor.com/replace_using_wildcards.htm.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

Reports that 0 found. Is this because they are in my dictionary?

Jay Freedman said:
In the Replace dialog, click the More button to display the bottom
half. Click in the Replace With box, then click the Format button and
choose Style from the menu. In the Style dialog, choose some style (Al
suggested Body Text 2) that isn't used anywhere else in the document,
and click OK. The text below the Replace With box will now show the
style you chose, and it will be applied to each find.

--
Regards,
Jay Freedman
Microsoft Word MVP
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

On Wed, 11 Jul 2007 14:06:01 -0700, irjic

I'm not sure how to do this. How do you add a unique style as stated in the
4th line?


:

Here is a way of finding all acronyms in a document:

Do a find/Replace with wildcards:
Find <[A-Z]{2,}>
This is Beginning of word, at least 2 chars A-Z, end of word
Replace with: ~^p^&^p and a unique style not found in document. (the
tilde is an unused character in document) (I use Body Text 2)
Then do a Find ~^p style Body Text 2
Replace with ^p style Normal.
The result is a paragraph with each acronym with a unique style.
Then Insert a List of figures at the top of the document using Style Body
Text 2.
Copy the List of Figures, sort and delete duplicates.



'Autogenerated' is asking a lot, but you can easily copy selected
Acronyms to a table for later creation into a list with a simple
macro. Create a two column/one row empty table. Put the cursor below
the table and save it. Substitute the name and path for the filename
in the following macro.
 

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