By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
444,077 Members | 2,121 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 444,077 IT Pros & Developers. It's quick & easy.

Word automation version problem.

P: n/a
I have VB.Net VS2005 App which creates MS Word documents. Clients are using
Word 2000 and Word2003.
Project refers to MS Word 9.0 Object library, declaring Word as an object.
On the Word 2000 machines this works fast and nice, but on the Word 2003
machines it takes 5-10 times longer.
Is there a way to make Word 2003 clients to work faster?

Recently a warning message, showed up in the error list:
"There are updated custom wrappers available for the following referenced
components: Office ,VBIDE. "

A search on this message did not result in any hit that could explain what
to do?

Regards
Jens

May 22 '06 #1
Share this Question
Share on Google+
4 Replies


P: n/a
This will always appear as long as you are using an older library.

My experience was the same as you on Word 2003 automation vs older versions.

Are you writing a dataset? If so, how much data and are you writing it cell
by cell? seeing your code would help a lot to determine if there are
improvements that can be made.

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"JensB" <Je***@newsgroup.nospam> wrote in message
news:O3**************@TK2MSFTNGP04.phx.gbl...
I have VB.Net VS2005 App which creates MS Word documents. Clients are using
Word 2000 and Word2003.
Project refers to MS Word 9.0 Object library, declaring Word as an object.
On the Word 2000 machines this works fast and nice, but on the Word 2003
machines it takes 5-10 times longer.
Is there a way to make Word 2003 clients to work faster?

Recently a warning message, showed up in the error list:
"There are updated custom wrappers available for the following referenced
components: Office ,VBIDE. "

A search on this message did not result in any hit that could explain what
to do?

Regards
Jens

May 22 '06 #2

P: n/a

"vbnetdev" <vb******@community.nospam> wrote in message
news:ew**************@TK2MSFTNGP03.phx.gbl...
This will always appear as long as you are using an older library.

My experience was the same as you on Word 2003 automation vs older
versions.

Are you writing a dataset? If so, how much data and are you writing it
cell by cell? seeing your code would help a lot to determine if there are
improvements that can be made.


The database contain some colums with Word documents stored as OLE objects.
(BLOBS)
I am then filling a dataset/dataview
I am streaming the BLOB to a temperary Word document, from where copy/paste
it to the main document

This is the part of the code doing the job and which is the slow part:
( i have tested an unnumbered ways to this in order to speed up WORD 2003,
but most of the time, the price is unstable performance)
This code works every time, but is slow, due to fact a new tmp doc is
created for each record.
A typical document contain about 20-30 records BLOBS + other stuff (Plain
text)

bytBLOBData = dvItem.Item(0).Row(Language)
'Begin after WORD Signature = 85 byte
Dim doc(bytBLOBData.Length() - 85) As Byte
For i = 85 To bytBLOBData.Length() - 85
doc(i - 85) = bytBLOBData(i)
Next

Dim file As New FileStream(System.Windows.Forms.Application.Startu pPath &
"\hcn.doc", FileMode.Create)
Dim strm As New MemoryStream(doc)
strm.WriteTo(file)
file.Flush()
file.Close()
file = Nothing
If wrdTMP Is Nothing Then wrdTMP = New Word.Application
document = Nothing
document =
wrdTMP.Documents.Open(System.Windows.Forms.Applica tion.StartupPath &
"\hcn.doc", , False)
document.Application.Selection.WholeStory()
document.Application.Selection.Copy()
wrdTMP.ActiveDocument.Close()
'************************************************* ************************************************** *******
GC.WaitForPendingFinalizers()
GC.Collect()
WRD.Activate()
'********************************************
'INSERT OLE OBJECT in main document
..Application.WordBasic.EditPaste()
..Selection.Document.Fields.Update()

Regards
Jens
May 22 '06 #3

P: n/a
can you tyr using simple tables instead of these objects and writing the
dataset to it?

--
Get a powerful web, database, application, and email hosting with KJM
Solutions
http://www.kjmsolutions.com

"JensB" <Je***@newsgroup.nospam> wrote in message
news:uj**************@TK2MSFTNGP05.phx.gbl...

"vbnetdev" <vb******@community.nospam> wrote in message
news:ew**************@TK2MSFTNGP03.phx.gbl...
This will always appear as long as you are using an older library.

My experience was the same as you on Word 2003 automation vs older
versions.

Are you writing a dataset? If so, how much data and are you writing it
cell by cell? seeing your code would help a lot to determine if there are
improvements that can be made.


The database contain some colums with Word documents stored as OLE
objects. (BLOBS)
I am then filling a dataset/dataview
I am streaming the BLOB to a temperary Word document, from where
copy/paste it to the main document

This is the part of the code doing the job and which is the slow part:
( i have tested an unnumbered ways to this in order to speed up WORD 2003,
but most of the time, the price is unstable performance)
This code works every time, but is slow, due to fact a new tmp doc is
created for each record.
A typical document contain about 20-30 records BLOBS + other stuff (Plain
text)

bytBLOBData = dvItem.Item(0).Row(Language)
'Begin after WORD Signature = 85 byte
Dim doc(bytBLOBData.Length() - 85) As Byte
For i = 85 To bytBLOBData.Length() - 85
doc(i - 85) = bytBLOBData(i)
Next

Dim file As New FileStream(System.Windows.Forms.Application.Startu pPath &
"\hcn.doc", FileMode.Create)
Dim strm As New MemoryStream(doc)
strm.WriteTo(file)
file.Flush()
file.Close()
file = Nothing
If wrdTMP Is Nothing Then wrdTMP = New Word.Application
document = Nothing
document =
wrdTMP.Documents.Open(System.Windows.Forms.Applica tion.StartupPath &
"\hcn.doc", , False)
document.Application.Selection.WholeStory()
document.Application.Selection.Copy()
wrdTMP.ActiveDocument.Close()
'************************************************* ************************************************** *******
GC.WaitForPendingFinalizers()
GC.Collect()
WRD.Activate()
'********************************************
'INSERT OLE OBJECT in main document
.Application.WordBasic.EditPaste()
.Selection.Document.Fields.Update()

Regards
Jens

May 23 '06 #4

P: n/a

"vbnetdev" <vb******@community.nospam> wrote in message
news:uP**************@TK2MSFTNGP03.phx.gbl...
can you tyr using simple tables instead of these objects and writing the
dataset to it?


In the real world, my customer have build up about 6000 documents during the
years, containing all the information he wants to give his customers.
If I try to convinst him to use simple tables or other solutions make it it
easy for the programmer, I believe there would no need for a programmer.
Jens
May 26 '06 #5

This discussion thread is closed

Replies have been disabled for this discussion.