tags:

views:

9

answers:

0

For Office 2007, we have the .NET component which invokes the word, it uses the Open() and Add() methods from the Word.Document.

Dim wrdDoc, wrdrtf As Word.Document wrdrtf = wrdApp.Documents.Open(objRTFPath, objMissing, objMissing, False, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing, objMissing) wrdDoc = wrdApp.Documents.Add(objTemplatepath, False, 0, True)

where objRTFPath = System.IO.Path.GetTempPath() & "1TFG3_" & nCount & ".rtf" and objTemplatepath is our customized template "TFG3_VSTOWord.dotx" and objMissing = System.Reflection.Missing.Value

These 2 methods gets executed in milliseconds/ a second in my local PC. But in other environments like dbWr@p, the log shows considerable amount of time for Open() and Add() alone. There was another user defined method which was taking about 8-10 seconds in local and after fix that is now reduced to 1-2 seconds depending on the template. So overall Word from the application opens in about 3 seconds in local PC while it takes around 35-40sec in dbWr@p.

I also created a sample application to test the time taken for Open() a normal word (outside application) and adding template to it. Upon execution of this sample exe in the other environment, I found that it took 7-9 seconds to open a normal word and add a template to it, while this takes only milliseconds in local.