Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
AutoFormat a grid in Word
Message
De
19/12/1999 09:37:21
Cetin Basoz
Engineerica Inc.
Izmir, Turquie
 
 
À
19/12/1999 07:23:07
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00305847
Message ID:
00305855
Vues:
42
>I am having problems automating a Word grid. This may be basic stuff for you guys but I am fairly new to this and I can't seem to sort it out. Does anybody have any ideas? Thanks in advance. Greg
>
>Here is my code ;
>
>#DEFINE True .T.
>#DEFINE False .F.
>
>&& Populates the grid
>WITH loTable
>FOR lnRow = 1 TO ALEN(laTableData, 1)
>FOR lnColumn = 1 TO ALEN(laTableData, 2)
>.Cell(lnRow,lnColumn).Range.InsertAfter(laTableData[lnRow,lnColumn])
>ENDFOR
>ENDFOR
>
>.AutoFormat ;
>(wdTableFormatGrid6, ;
> True, ;
> True, ;
> True, ;
> True, ;
> True, ;
> False, ;
> True, ;
> False, ;
> True)
>ENDWITH
>
>&& ERROR; 'variable wdTableFormatGrid6 is not found'
>
>=============================
>I have also tried:
>
>.AutoFormat ;
>Format:=wdTableFormatGrid6, ;
>ApplyBorders:= True, ;
>ApplyShading:=True, ;
>ApplyFont:=True, ;
>ApplyColor:=True, ;
>ApplyHeadingRows:=True, ;
>ApplyLastRow:=False, ;
>ApplyFirstColumn:=True,;
>ApplyLastColumn:=False, ;
>AutoFit:=True
>
>&& I get a Syntax error.


Greg,
wdTableFormatGrid6 is a VBA constant with a value of 21. Either define it or directly use 21.

#define wdTableFormatGrid1 16
#define wdTableFormatGrid2 17
#define wdTableFormatGrid3 18
#define wdTableFormatGrid4 19
#define wdTableFormatGrid5 20
#define wdTableFormatGrid6 21
#define wdTableFormatGrid7 22
#define wdTableFormatGrid8 23

Check files section for a file containing office constants.
Cetin
Çetin Basöz

The way to Go
Flutter - For mobile, web and desktop.
World's most advanced open source relational database.
.Net for foxheads - Blog (main)
FoxSharp - Blog (mirror)
Welcome to FoxyClasses

LinqPad - C#,VB,F#,SQL,eSQL ... scratchpad
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform