473,320 Members | 2,162 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Word automation version problem.

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
4 3670
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

"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
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

"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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: JP SIngh | last post by:
HI All I just wonder if anyone has created a word document using ASP. I am able to create a work document with ASP without any problem but what I want to do is slightly more than I know. I am...
3
by: Mike MacSween | last post by:
Office 2000 From Access I've been starting an instance of word and doing a mail merge. Everything hunky-dory until I applied SP1 yesterday. Now this: dim wrd as Object set wrd =...
12
by: Cheval | last post by:
Has anyone had any problems with inter-office automation between MS Word and MS Access in Office 2003? I have recently installed office 2003 in a new folder and have left the older office 2000...
4
by: Daniel | last post by:
Hello, i have a problem with the word automation from c#. First, i want to mention, that i don't have any dependencies from word in my c#-project, i want to use the system.reflection model to...
0
by: mharris | last post by:
I need help with merging two Word documents into one through C# code. The problem isn't so much getting the documents put into one as it is maintaining the appropriate formatting, or rather...
2
by: Radek | last post by:
Hi, I have got such problem: in my directory "C:\folder" I have 3 files in MS WORD (having tables, images etc), these are: "1.doc", "2.doc", "3.doc". I want to write an application (C# of...
12
by: Evan Stone | last post by:
If one is developing a .NET application, how can I develop an application that uses COM automation that targets multiple versions of Word? For example, the signature for the Document.Open method is...
4
by: Nikhil Patel | last post by:
Hi all, I need to generate a word document and save it on the server from an ASP.Net application. Basically I want to load a word template and insert some field values from a dataset and save...
2
by: Andrew Cranwell | last post by:
Hi, Please redirect me if I am in the wrong group for this question... this is my first post to this group, so I hope it is clear! I am working on an automation project in VB.NET and have to...
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
0
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.