Results 1 to 5 of 5
  1. #1
    4 Star Lounger
    Join Date
    Apr 2001
    Posts
    482
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Getting around merged table cells (VBA Word 2000)

    I have set of macros I use to format documents created from web help that have been saved to Word documents. I have recently encountered problems with some of the code that formats tables when there are vertically or horizontally merged cells. I've seen a few posts on the Word forum that have mentioned this problem, but I could not find any solutions.

    My guess is that the safest solution would be to:

    1. Determine which cells are merged and whether they are merged vertically or horizontally.
    2. Unmerge (split) the merged cells.
    3. Mark them with some strange text to show that they used to be merged and whether they were merged vertically or horizontally.
    4. Do my existing code.
    5. Go back after I've done everything else and remerge.

    I can code steps 2 through 5 with no problem. What I'm unsure about is the best way to do step 1.

    Any ideas?

    Thanks!!
    Troy

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

    Re: Getting around merged table cells (VBA Word 2000)

    I tried to do this once and really struggled. I ended up extracting the HTML version of the document and parsing the HTML to get all the table layouts. There must be a more efficient way so I hope that someone else can post something more helpful!

    StuartR

  3. #3
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting around merged table cells (VBA Word 2000)

    No, I do it the same way. For some kludges, you might look at http://www.mvps.org/word/FAQs/Macros...RowColSpan.htm.

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

  4. #4
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts

    Re: Getting around merged table cells (VBA Word 2000)

    Like Stuart, I wasted a lot of time on this at some point last year. VBA just doesn't seem to make the information available in a reliable manner.

  5. #5
    5 Star Lounger
    Join Date
    May 2001
    Location
    Stuttgart, Baden-W, Germany
    Posts
    931
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Getting around merged table cells (VBA Word 2000)

    <AOL>Me too</AOL>

    Though it seems to be available to Word itself when it saves as HTML.

    Hope mswish@microsoft.com will get a lot of requests for making the rowspan and colspan available through VBA.
    If you drop them an email, mention "Word" and "VBA" in the header, so it gets routed to the right people...

    <img src=/S/cheers.gif border=0 alt=cheers width=30 height=16> Klaus

Posting Permissions

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