Information générale
Catégorie:
COM/DCOM et OLE Automation
Here's a snippet of code. I hope this is helpful.
oWord.ActiveDocument.Tables.Add( oWord.Selection.range, RECCOUNT() + 2, cColumnCount )
WITH oWord.Selection
.MoveRight( wdCharacter, cColumnCount , wdExtend)
.MoveDown( wdLine, RECCOUNT() + 2, wdExtend)
.Borders(wdBorderTop).LineStyle = wdLineStyleNone
.Borders(wdBorderLeft).LineStyle = wdLineStyleNone
.Borders(wdBorderBottom).LineStyle = wdLineStyleNone
.Borders(wdBorderRight).LineStyle = wdLineStyleNone
.Borders(wdBorderHorizontal).LineStyle = wdLineStyleNone
.Borders(wdBorderVertical).LineStyle = wdLineStyleNone
.MoveLeft( wdCharacter, 1)
ENDWITH
WITH oWord.Selection
.MoveRight( wdCharacter, cColumnCount, wdExtend)
.Borders(wdBorderBottom).LineStyle = wdLineStyleSingle
.MoveLeft( wdCharacter, 1)
ENDWITH
WITH oWord
.Selection.Tables(1).Columns(1).SetWidth(70, wdAdjustNone)
.Selection.Tables(1).Columns(2).SetWidth(30, wdAdjustNone)
.Selection.Tables(1).Columns(3).SetWidth(53, wdAdjustNone)
.Selection.Tables(1).Columns(4).SetWidth(53, wdAdjustNone)
.Selection.Tables(1).Columns(5).SetWidth(60, wdAdjustNone)
.Selection.Tables(1).Columns(6).SetWidth(214,wdAdjustNone)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.Font.Bold = wdToggle
= mpWriteDetail( '','AirDate', .T.)
.Selection.MoveRight( wdCell)
.Selection.Font.Bold = wdToggle
= mpWriteDetail( "",'Type', .T.)
.Selection.MoveRight( wdCell)
.Selection.Font.Bold = wdToggle
= mpWriteDetail( "",'Episode #', .T.)
.Selection.MoveRight( wdCell)
.Selection.Font.Bold = wdToggle
= mpWriteDetail( "",'Title', .T.)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
.Selection.MoveRight( wdCell)
ENDWITH
Précédent
Suivant
Répondre
Voir le fil de ce thread
Voir le fil de ce thread à partir de ce message seulement
Voir tous les messages de ce thread
Voir tous les messages de ce thread à partir de ce message seulement