Novo

Forum kao aplikacija na telefonu

Dodajte forum na početni ekran i koristite ga kao aplikaciju, sa menijem na dnu ekrana.

  • 1 odgovor
  • 5.194 pregleda

Najnovija ↓

Merge word-ovih celija kroz VB 6 cod 21.02.2004. u 12:40 · pre 276 meseci #1
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
Re: Merge word-ovih celija kroz VB 6 cod 19.03.2004. u 12:23 · pre 275 meseci #2
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.
Potpis
Blue Man Group
Prijavite se da biste odgovorili u ovoj temi.PrijavaRegistracija

Premeštanje teme