[ anebojsa @ 21.02.2004. 11:40 ] @
Treba mi pomoc

Visual basic 6
XP Office

Nakon upisivanja podataka u word-ov dokument, treba mi kroz kod spajanje dve ili vise celija.

Code:

Option Explicit 
Dim WordObj As Word.Application 
Dim WordDoc As Word.Document 
Dim WordTab As Word.Table 
Dim row1 As Integer 
Dim col1 As Integer 

Public Sub zastampanjeword() 

Set WordObj = CreateObject("Word.Application") 
Set WordDoc = WordObj.Documents.Open(App.Path & "\Dokument.dot") 
Set WordTab = WordDoc.Tables.Item(1) 

Let row1 = 1 
Let col1 = 1 

'kod za spajanje dve ili vise celija 

End Sub
[ mladenovicz @ 19.03.2004. 11:23 ] @
Code:

'This example merges the first two cells in table one 
' in the active document with one another
If ActiveDocument.Tables.Count >= 1 Then
    With ActiveDocument.Tables(1)
        .Cell(Row:=1, Column:=1).Merge _
            MergeTo:=.Cell(Row:=1, Column:=2)
        ' or
        '.Cell(1, 1).Merge (.Cell(1, 2))
    End With
End If


Znaci, Word.Table objekat ima Cell objekat, a Cell ima Merge metod.