Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Word Auto: Merging Cells in table
Message
General information
Forum:
Visual FoxPro
Category:
Coding, syntax & commands
Environment versions
Visual FoxPro:
VFP 9 SP1
OS:
Windows XP SP2
Network:
Windows 2003 Server
Database:
Visual FoxPro
Application:
Desktop
Miscellaneous
Thread ID:
01414868
Message ID:
01415362
Views:
40
Great...thanks. I have a couple of follow up questions just so I conceptually am thinking of this stuff properly. See below.

>Second method is suitable when, say, cells are selected, or you want to merge all cells in the table:
oWord.Selection.Cells.Merge()    && preselected cells
*or
with oWord.ActiveDocument
    .Range(.Tables(1).Cell(1,2).Range.Start, .Tables(1).Cell(1,3).Range.End).Cells.merge
endwith
*or
oWord.Activedocument.Table(2).Cells.Merge()
Question: so are you saying that as long as my range starts at the beginning of the first cell and ends at the end of the 2nd cell that I can then safely merge them? I am familiar with working with ranges in the "text" of a document, just not so familiar with the table stuff.


>Other than that, be carefull introducing object references to the pieces of the document. In most cases you can do it with single oWord object reference, like:
with oWord.ActiveDocument.Tables(2).Range
       .Cells(1).Merge(.Cells(3))
endwith
> Otherwise if you do not want Office applications remain sitting hidden after you close your application, then you need to release all objects properly, and in the proper sequence from child to parent.

For readability sake, I often instantiate things like oTable and oRange (along with oWord and oDocument) - have you seen problems with these being worked with but then not released in the right order? In my app, they just all go out of range at then of a method etc. - so I don't really "order" the releasing of them (although I guess I could).

Albert

>Good Luck
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform