Results 1 to 4 of 4
  1. #1
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Cherrybrook, New South Wales, Australia
    Posts
    116
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Macro to remove Information Mapping (2003)

    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

  2. #2
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro to remove Information Mapping (2003)

    You should be able to do something with a macro like this:
    <code>
    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
    </code>
    You may need to change the separator, or do a slightly more complex check for borders, depending on your document.

    StuartR

  3. #3
    2 Star Lounger
    Join Date
    Nov 2004
    Location
    Cherrybrook, New South Wales, Australia
    Posts
    116
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Macro to remove Information Mapping (2003)

    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

  4. #4
    Plutonium Lounger
    Join Date
    Nov 2001
    Posts
    10,550
    Thanks
    0
    Thanked 7 Times in 7 Posts

    Re: Macro to remove Information Mapping (2003)

    Thanks for sharing the results of your efforts.

    StuartR

Posting Permissions

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