Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #2  
Old 03-29-2018, 01:25 PM
macropod's Avatar
macropod macropod is offline Auto generation of a Glossary of terms Windows 7 64bit Auto generation of a Glossary of terms Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,521
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

Try:
Code:
Sub TabulateKeyTerms()
Application.ScreenUpdating = False
Dim Doc As Document, RefDoc As Document, Rng As Range
Dim StrTerms As String, strFnd As String, StrPages As String
Dim r As Long, j As Long, StrOut As String, StrBreak As String
Set Doc = ActiveDocument
Set RefDoc = Documents.Open("Drive:\FilePath\KeyTerms.doc", ReadOnly:=True, AddToRecentFiles:=False)
For r = RefDoc.Tables(1).Rows.Count To 1 Step -1
  strFnd = Trim(Split(RefDoc.Tables(1).Cell(r, 1).Range.Text, vbCr)(0))
  With Doc.Content
    With .Find
      .ClearFormatting
      .Replacement.ClearFormatting
      .Format = False
      .Text = strFnd
      .Wrap = wdFindStop
      .MatchWholeWord = True
      .MatchWildcards = False
      .MatchCase = True
      .Execute
    End With
    If .Find.Found = False Then RefDoc.Tables(1).Rows(r).Delete
Next r
Set Rng = Doc.Range.Characters.Last
Rng.FormattedText = RefDoc.Tables(1).Range.FormattedText
RefDoc.Close False
Set Rng = Nothing: Set RefDoc = Nothing
Application.ScreenUpdating = True
End Sub
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Auto generation of a Glossary of terms Creating sidebar (or wide margin) for glossary items almagary Word Tables 3 01-23-2018 04:34 PM
Auto generation of a Glossary of terms Best Practice for Indexing Multiple Word Terms and Sub-Terms jhy001 Word 4 11-06-2017 02:08 PM
Auto Generation of Hyperlinks cooloox Excel Programming 4 03-27-2017 06:47 AM
Auto generation of a Glossary of terms Keyboard shortcut for glossary styles Jennifer Murphy Word 1 01-06-2016 09:19 AM
Auto generation of a Glossary of terms Invoice Number Generation mrphilk Excel 2 06-08-2010 12:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:27 PM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft