Consulting

Results 1 to 10 of 10

Thread: Cataloging blocks of text

  1. #1

    Cataloging blocks of text

    For some time I have been wondering if there is a way to label blocks of contract text in the background then run a vba macro to list those labels in a separate report to catalog the contents of the document.
    the benefit would be to quickly view what versions of contract terms are found in each document so that when laws change we can have a master catalog to locate text blocks that need amending. After amending the text block we could give it a new version label and update our master catalog. Is this possible?

  2. #2
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    Not sure what you are trying to do. However, if I had say 100 document templates that each contained text related to a law, statute, or regulation subject to change, then I would probably have the text in a content control and when I created a document based on that template I would use VBA to insert the text from a separate building block library of various laws, statutes and regulations that concerned my business. As long as you keep the library updated then your documents are updated.
    Greg

    Visit my website: http://gregmaxey.com

  3. #3
    Knowledge Base Approver VBAX Guru macropod's Avatar
    Joined
    Jul 2008
    Posts
    4,435
    Location
    You could use a 'parent' document with all the standard 'blocks', with INCLUDETEXT fields in all its 'child' documents to link the content. That way, any change in the 'parent' document will update all its 'child' documents. Be warned, however, that maintaining such links to existing contracts, for example, can have serious legal implications if you go changing their content retrospectively. To avoid that, you should break the links in such 'child' documents as soon as the contract terms are agreed. See: https://support.office.com/en-us/art...a-2ff950fb629e
    Cheers
    Paul Edstein
    [Fmr MS MVP - Word]

  4. #4
    Thank you both. I guess what I am trying to do is assign a unique name to each block of text "behind the scenes" and then be able to run a report to list each unique name contained in the document. This would allow me to monitor which document has which clauses.

  5. #5
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    If that is all you want to do then you could wrap your blocks of text in richtext CCs and use the tag property to define that CC as a monitored CC and ID the text block
    E.g., your CC tags would look something like this "Monitor|USC 9.1.1", "Monitor|CA 123" etc.

    Run this code:

    Sub ScratchMacro()
    'A basic Word macro coded by Greg Maxey, http://gregmaxey.com/word_tips.html, 3/26/2018
    Dim oCC As ContentControl
    Dim arrTagParts() As String
    Dim strReport As String
      For Each oCC In ActiveDocument.ContentControls
        arrTagParts = Split(oCC.Tag, "|")
        If UBound(arrTagParts) > 0 Then
          If arrTagParts(0) = "Monitor" Then
            strReport = strReport & arrTagParts(1) & vbCr
          End If
        End If
      Next oCC
      MsgBox strReport
    lbl_Exit:
      Exit Sub
    End Sub
    Greg

    Visit my website: http://gregmaxey.com

  6. #6
    That sounds great. Thanks. I will give that a try in a couple days when I get back to my home office.
    Thanks much
    Kenn

  7. #7
    Thank you!! That worked great.
    Would you happen to know how I could get that to print out the list of tags either at the bottom of the document or on a separate word doc?
    Thanks again.

    U DA MAN!

  8. #8
    PS- Thanks for your service in the Navy!

  9. #9
    Microsoft Word MVP 2003-2009 VBAX Guru gmaxey's Avatar
    Joined
    Sep 2005
    Posts
    3,335
    Location
    Quote Originally Posted by KennStewart View Post
    PS- Thanks for your service in the Navy!
    Replace MsgBox with ActiveDocument.Range.InsertAfter & vbcr
    Greg

    Visit my website: http://gregmaxey.com

  10. #10
    That worked great. Thanks much!
    Kenn

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •