![]() |
#2
|
||||
|
||||
![]()
Hi tinfanide,
When developing automation code, it's often simpler to develop the target application's code in that application, then copy it to the automating application. In Word, when you merge cells horizontally, only the left-most cell remains. Similarly, when you merge cells vertically, only the top-most cell remains. You can no longer address any of the other cells in the merged range. Try something based on the following Word macro: Code:
Sub Demo() Dim Rng As Word.Range, oDoc As Word.Document Set oDoc = ActiveDocument With oDoc.Tables(1) Set Rng = .Cell(4, 2).Range Rng.End = .Cell(6, 2).Range.End Rng.Cells.Merge Rng.Text = "Merged Column Cells" End With End Sub
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tinfanide | Word VBA | 12 | 02-09-2012 12:05 AM |
![]() |
Spanec | Excel | 2 | 01-12-2012 09:15 AM |
Count range cells eliminating merge cells | danbenedek | Excel | 0 | 06-15-2010 12:40 AM |
![]() |
StarWeaver | Excel | 1 | 03-02-2010 01:41 PM |
How do I reference a merged cell in a multi column & row table in MS Word ('03')? | jihanemo | Word Tables | 0 | 03-18-2009 08:33 AM |