Home > database >  Pb word text form mixed operation
Pb word text form mixed operation

Time:09-26

I am going to put a table of the grid is exported to the word, this has been done, but how can add header and tabulating date after the header bold center?
So I write the results of the export table header after missing the content and form also bold centered, and if you don't adjust the header font position, there is no any problem, also in the header,

Ole_object. Documents. The Add ()
Ole_object. Selection. Typetext (STR)
Ole_object. Selection. MoveLeft (1, len (STR), 1)
Ole_object. Selection. The Font. The Name="bold"
Ole_object. Selection. The Font, Size=14
Ole_object. Selection. The Font, Bold=True
Ole_object. Selection. ParagraphFormat. Alignment=2
Ole_object. Selection. TypeText (" ~ r ~ n)
Ole_object. ActiveDocument. Tables. The Add (ole_object. Selection. Range, Ll_RowNum, Ll_ColNum, wdword9tablebehavior, wdautofitfixed)

STRING Ls_ColName
The INTEGER I, j

FOR I=1 TO Ll_ColNum
//get the name of the column header
Ls_ColName=dw_1. The Describe (' # '+ STRING (I) + ". The name ") + "_t"
Ls_value=https://bbs.csdn.net/topics/dw_1.Describe (Ls_ColName + "text")
Ole_object. Selection. TypeText (TRIM (Ls_Value))
Ole_object. Selection. MoveRight (wdCell)
NEXT

Dw_1. SetRedraw (FALSE)
Ole_object. Selection. MoveLeft (wdCell)

FOR I=2 TO Ll_RowNum
FOR j=1 TO Ll_ColNum
Dw_1. ScrollToRow (I - 1)
Dw_1. SetColumn (j)
Ls_Value=(https://bbs.csdn.net/topics/dw_1.GetText)
Ole_object. Selection. MoveRight (wdCell)
Ole_object. Selection. TypeText (ls_value)
NEXT
NEXT
Dw_1. SetRedraw (TRUE)

CONSTANT LONG wdFormatDocument=0

//save the new document
Ole_object. ActiveDocument. SaveAs (" daybb. Doc, "0, FALSE," ", TRUE, "", FALSE, FALSE, FALSE, FALSE, FALSE)

//disconnect OLE
Ole_Object. DisConnectObject ()
DESTROY Ole_Object

CodePudding user response:

It can check the VBA for word.

CodePudding user response:

Really want to call the VBA

CodePudding user response:

Ask the pb in packetsize for speed requirements
  • Related