Question

Locked

Populating data from VB6 to Word 07

By johnnylimfx ·
I've an application written using VB6. The application requires to populate data on MS word 07 and once it is done it will save the file on the computer. The problem i encountered is when during the population of the data called by the application; the population seems to be very slow compare to Ms Word 03 or Ms Word 2000. Time difference was doubled. (e.g. Word 03 takes <20 sec and Word 07 takes >40 sec) this application sits locally and doesn't use the network.

The actions i tired so far are:-
- Disable McAfee Antivirus
- Clean Installation of Ms Office 2007
- Disable all add-ons of Ms Word 07

My question is whether is this a standard problem from MS office 07 or is that something i have to change at the code which works well with word 07?

Here is the portion of the code i'm using:-

Set mroWord = CreateObject("Word.basic")
mroWord.Appminimize ("Microsoft Word"), 1
mroWord.Appmaximize ("Microsoft Word"), 1
mrsFileSavePath = "C:\MEAA\AAGeneration\Tmp\"
lsOutputFile = mrsFileSavePath & "OfficeWord2007" & nvOutputFileExtn

mrsTemplateDir = "C:\MEAA\AAGeneration\Templates\" & "MsWord2007Template" & nvTemplateFileExtn

Call mroWord.filenew(Template:=mrsTemplateDir)

Call mroWord.filesaveas(lsOutputFile, Format:=1)


mroWord.EditBookmark Name:="bmkTableBegin", Goto:=True
Call mroWord.TableInsertTable(ConvertFrom:="", NumColumns:="7", NumRows:="2", InitialColWidth:="Auto", Format:="0", Apply:="167")
Call mroWord.FormatBordersAndShading(ApplyTo:=2, TopBorder:=1, LeftBorder:=1, BottomBorder:=1, RightBorder:=1, HorizBorder:=1, VertBorder:=1, TopColor:=0, LeftColor:=0, BottomColor:=0, RightColor:=0, HorizColor:=0, VertColor:=0, FromText:="0 pt", Foreground:=0, Background:=0, Tab:="0")

Call mroWord.startofrow
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="0.7")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="1.38")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="3.12")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="0.5")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="1.13")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="1.25")
Call mroWord.startofrow
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.nextcell
Call mroWord.tableselectcolumn
Call mroWord.TableColumnWidth(ColumnWidth:="1.75")

mroWord.EditBookmark Name:="bmkTableBegin", Goto:=True
'data binding
mroWord.Bold
mroWord.Insert "AA ID"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "AA Number"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "Borrower Name"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "LU"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "Loan Sector"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "AA Limit"
Call mroWord.nextcell
mroWord.Bold
mroWord.Insert "Customer Class"
Call mroWord.nextcell


For llCnt = 0 To UBound(lvResult, 2)

mroWord.Insert " " & CStr(lvResult(0, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(1, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(2, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(3, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(4, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(5, llCnt))
mroWord.nextcell
mroWord.Insert " " & CStr(lvResult(6, llCnt))
mroWord.nextcell

Next

Call mroWord.filesave
Call mroWord.fileclose
Call mroWord.fileexit

This conversation is currently closed to new comments.

2 total posts (Page 1 of 1)  
| Thread display: Collapse - | Expand +

All Answers

Share your knowledge
Back to Software Forum
2 total posts (Page 1 of 1)  

Related Discussions

Related Forums