|
web
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
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 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. -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "JensB" <JensB@newsgroup.nospam> wrote in message news:O3rvqAYfGHA.3888@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 > > > "vbnetdev" <vbnetdev@community.nospam> wrote in message The database contain some colums with Word documents stored as OLE objects. news:ew8K9zYfGHA.4276@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. > (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.StartupPath & "\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.Application.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 can you tyr using simple tables instead of these objects and writing the
dataset to it? -- Show quoteHide quoteGet a powerful web, database, application, and email hosting with KJM Solutions http://www.kjmsolutions.com "JensB" <JensB@newsgroup.nospam> wrote in message news:ujBToRZfGHA.4776@TK2MSFTNGP05.phx.gbl... > > "vbnetdev" <vbnetdev@community.nospam> wrote in message > news:ew8K9zYfGHA.4276@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.StartupPath & > "\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.Application.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 > "vbnetdev" <vbnetdev@community.nospam> wrote in message In the real world, my customer have build up about 6000 documents during the news:uPvoh0qfGHA.3468@TK2MSFTNGP03.phx.gbl... > can you tyr using simple tables instead of these objects and writing the > dataset to it? 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
But what about them hackers?
Resetting the value of a System.Web.UI.HtmlControls.HtmlInputFile Order of events, databinding, and UserControls Ayuda contra unos programadores de Linux y PHP que me quieren dañar un negocio Really puzzled (or maybe just totally confused) about VB.NET and ADO.NET AppStartup "Cancel" leaves splash form loaded Stepping through datagridview rows in code Setup question Custom Datagridstyle converting a string to it's enum (integer) equivalent |
|||||||||||||||||||||||