×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Jobs

Abbreviations and Acronyms Table - Auto Compile

Abbreviations and Acronyms Table - Auto Compile

Abbreviations and Acronyms Table - Auto Compile

(OP)
Big document - over 150 pages - with LOADS of Acronyms and Abbreviations. Table at the end listing them all. How can I make sure I get every initial (no pun intended) occurrence of an abbreviation and put it in the table? Also, check the other way, to make sure every abbreviation defined in the table is in the document.

Chris

Someday I'll know what I'm donig...damn!

RE: Abbreviations and Acronyms Table - Auto Compile

Try:

CODE

Sub Demo()
Application.ScreenUpdating = False
Dim RngDoc As Range, oTbl As Table, strFnd As String, i As Long
With ActiveDocument
  Set oTbl = .Tables(.Tables.Count)
  Set RngDoc = ActiveDocument.Range
  RngDoc.End = oTbl.Range.Start
  For i = 2 To oTbl.Rows.Count
    With oTbl.Cell(i, 1).Range
      strFnd = Left(.Text, Len(.Text) - 2)
    End With
    With RngDoc
      With .Find
        .ClearFormatting
        .Replacement.ClearFormatting
        .Format = False
        .Text = strFnd
        .MatchWholeWord = True
        .MatchWildcards = False
        .MatchCase = True
        .Execute
      End With
      If .Find.Found = True Then
        oTbl.Cell(i, 2).Range.Text = .Information(wdActiveEndAdjustedPageNumber)
      End If
    End With
  Next
End With
Application.ScreenUpdating = True
End Sub 
The code assumes the acronyms are in the first column and the initial page # is to appear in the second column.

As for the second problem, you might try something based on the discussion starting at: https://windowssecrets.com/forums/showthread.php/1...

Cheers
Paul Edstein
[MS MVP - Word]

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members!

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close