• Macro to remove Information Mapping (2003)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Macro to remove Information Mapping (2003)

    Author
    Topic
    #435652

    I have inherited a library full of documents that have been set up using Information Mapping.

    I am considering writing a macro to remove all the tables that are just used for layout. I need to leave any tables that have real tabular material in them.
    I’d love to hear from anyone that has already written such a macro.
    The real tables have borders but the layout tables don’t.

    If someone can can point me in the right direction, I would be appreciative.

    Thanks in advance,
    Judith

    Viewing 0 reply threads
    Author
    Replies
    • #1030308

      You should be able to do something with a macro like this:

      Sub delTablesWithoutBorders()
      Dim tbl As Table

      For Each tbl In ActiveDocument.Tables
      If Not tbl.Borders.Enable Then
      tbl.ConvertToText Separator:=" "
      End If
      Next tbl

      End Sub

      You may need to change the separator, or do a slightly more complex check for borders, depending on your document.

      StuartR

      • #1030640

        Thanks Stuart.

        I added the parameter to leave nested tables (which are usually real tables) and changed the separator to paragraph mark since the first column of each layout table is usually a Heading 5 that I want to keep.

        I cleaned up a 300 page document in seconds. Now I can change a few styles and remove the blank lines and print the finished document!

        Thanks again,
        Judith

        Sub delTablesWithoutBorders()
        ‘macro to remove borderless tables used for layout in Information Mapping
        Dim tbl As Table

        For Each tbl In ActiveDocument.Tables
        If Not tbl.Borders.Enable Then
        tbl.ConvertToText Separator:=wdSeparateByParagraphs, NestedTables:=False
        End If
        Next tbl

        End Sub

        • #1030642

          Thanks for sharing the results of your efforts.

          StuartR

    Viewing 0 reply threads
    Reply To: Macro to remove Information Mapping (2003)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: