Word 2000 DDE Speed

S

Stefan German

Hi all!

In our office we use MS Word 95 for communication with clients. Data
are delivered by custom application, which uses DDE to compose
documents and insert data into corresponding bookmarks. Whole process
was fine, however, because of non-technical reasons we have to switch
from MS Word 95 to MS Word 2000. Almost everything works fine with
W2000, except some incompatibility in document formating (we use CZ
version of Word). But, with MS Word 2000 we have serious performance
problems. We used to process 2000 documents with in 40 minutes, W95,
but only about one third of this amount after switching to W2000.

I tried to process test set of documents on different machine. I
found, that performance is machine (setup) specific. On another
machine (with lower specs - notebook) it worked just about the same
performance for both of Words. I tried to compare setting, but setting
is also not a case. Slower machine with the same setting is about the
same using W95, but is much faster with W2000. (On this machine,
performance of W95 is about the same as of W2000)

Slowest part of process (with w2000 on terimanl) is inserting values
into bookmarks. Word sometime freezes for few seconds. Sometime
between inserting of values formating of document changes. Strange...

Summary:
Terminal - P4 2.2GHz, 512 RAM, w2k server eng, word 95 CZ+ MS Office
2000 CZ - Word 95 fast, Word 2000 slow
Notebook PM 1.5GHz, 256 RAM, w2k prof eng, word 95 CZ+ MS Office 2000
CZ - Word 95 fast, Word 2000 fast

My "only" limitation is that I can not reinstall or use other
software/hardware. Anyway, I asked for reinstalling Office 2000, but
it did not help.

Thanks for any idea.
 
D

Doug Robbins - Word MVP

How are you inserting the information into the bookmarks?

You should do it by using the .Range of the bookmarks and either
..InsertBefore or .InsertAfter

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
S

Stefan German

I'm using EditGoTo and Insert commands for inserting information into bookmark.
 
D

Doug Robbins - Word MVP

That would be why it is so slow.

Use

With ActiveDocument
.Bookmarks("bm1name").Range.InsertBefore [text]
.Bookmarks("bm2name").Range.InsertBefore etc.


End With

Every time you use GoTo, Word has to move to that part of the document and
redraw the screen. That takes time. You will find the above method a lot
quicker.

--
Please post any further questions or followup to the newsgroups for the
benefit of others who may be interested. Unsolicited questions forwarded
directly to me will only be answered on a paid consulting basis.

Hope this helps
Doug Robbins - Word MVP
 
C

Cindy M -WordMVP-

Hi Stefan,

Yes, this problem is installation-specific. I had a machine once where
DDE was slower than molasses, and never could figure out what caused
it. The problem isn't really Word, but in how Windows and the hardware
is dealing with DDE. You could try a harddrive reformat and
reinstalling everything. Or just use a different machine.
I'm using EditGoTo and Insert commands for inserting information into bookmark.

"Doug Robbins - Word MVP" <[email protected]> wrote in message

In our office we use MS Word 95 for communication with clients. Data
are delivered by custom application, which uses DDE to compose
documents and insert data into corresponding bookmarks. Whole process
was fine, however, because of non-technical reasons we have to switch
from MS Word 95 to MS Word 2000. Almost everything works fine with
W2000, except some incompatibility in document formating (we use CZ
version of Word). But, with MS Word 2000 we have serious performance
problems. We used to process 2000 documents with in 40 minutes, W95,
but only about one third of this amount after switching to W2000.

I tried to process test set of documents on different machine. I
found, that performance is machine (setup) specific.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
C

Cindy M -WordMVP-

Hi Doug,

He can't use VBA code if the application is communicating
with Word via DDE. It's the DDE configuration on a
particular machine that's the problem.
That would be why it is so slow.

Use

With ActiveDocument
.Bookmarks("bm1name").Range.InsertBefore [text]
.Bookmarks("bm2name").Range.InsertBefore etc.


End With

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
S

Stefan German

Hi all.

Just confirming Cindy: I (our application) really cannot use VBA code
to communicate with Word. I will try to persuade our admins to spare
some time on reinstalling some machines. ;-)

I hope this will also help to solve another problem (which in final is
more disturbing than performance problems). Word 2000 (unlike Word 95)
has problems with big sets of documents. After composing about 500
documents, Word 2000 is not able to close document and open following.
Bookmark setting is performed on open document, but another operations
are not done (opening, closing, printing). (No errors reported by
Word.) I don't know if it is caused by implementation of wordbasic in
Word 2000 or by problems with DDE connections. I have to remark again,
that with Word 95 everything is fine.

I will have to investigate and study something about DDE connections
and go trough Microsoft's knowledge base.

Cindy M -WordMVP- said:
Hi Doug,

He can't use VBA code if the application is communicating
with Word via DDE. It's the DDE configuration on a
particular machine that's the problem.
That would be why it is so slow.

Use

With ActiveDocument
.Bookmarks("bm1name").Range.InsertBefore [text]
.Bookmarks("bm2name").Range.InsertBefore etc.


End With

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)


This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
J

Jay Freedman

Hi, Stefan,

This post opens a new question that wasn't mentioned in the thread before.
When you brought your application from Word 95 to Word 2000, did you do any
reprogramming to replace the old WordBasic code with the corresponding VBA
constructs? I'm guessing you did not, and that may account for some of the
problems you're seeing.

In Word 97 and later, VBA is the macro programming language. It contains a
"WordBasic object" that implements most of the old WordBasic functionality
from Word 95 and before, but it is *not* the same thing. You're going
through an extra layer of abstraction and interpretation. I don't know
specifically of any memory leaks or other problems in the WordBasic object,
but you may be stressing it more than most users.

Besides that, VBA has ways of doing things that were difficult or impossible
in WordBasic. For example, you can manipulate objects in a document --
paragraphs, tables, graphics, etc. -- without having to select them. There
are many new string and array functions. By using only what was available in
Word 95, you're probably losing an order of magnitude of speed.

If you need to process large numbers of documents using VBA -- that is, if
you can ever get away from DDE -- then you should plan on rewriting your
macros in native VBA. Of course, if you wait a couple of years, you'll
probably be able to go straight to VB.Net. ;-)

--
Regards,
Jay Freedman
Microsoft Word MVP

Stefan said:
Hi all.

Just confirming Cindy: I (our application) really cannot use VBA code
to communicate with Word. I will try to persuade our admins to spare
some time on reinstalling some machines. ;-)

I hope this will also help to solve another problem (which in final is
more disturbing than performance problems). Word 2000 (unlike Word 95)
has problems with big sets of documents. After composing about 500
documents, Word 2000 is not able to close document and open following.
Bookmark setting is performed on open document, but another operations
are not done (opening, closing, printing). (No errors reported by
Word.) I don't know if it is caused by implementation of wordbasic in
Word 2000 or by problems with DDE connections. I have to remark again,
that with Word 95 everything is fine.

I will have to investigate and study something about DDE connections
and go trough Microsoft's knowledge base.

Cindy M -WordMVP- said:
Hi Doug,

He can't use VBA code if the application is communicating
with Word via DDE. It's the DDE configuration on a
particular machine that's the problem.
That would be why it is so slow.

Use

With ActiveDocument
.Bookmarks("bm1name").Range.InsertBefore [text]
.Bookmarks("bm2name").Range.InsertBefore etc.


End With

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)


This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 
C

Cindy M -WordMVP-

Hi Stefan,

I'm assuming that I've understood you correctly, and none of the
automation code is actually within Word? (Jay seems to be making the
same wrong(?) assumption that Doug did...)

But Jay is correct on the point that the commands DDE uses to
communicate with Word 97/2000/2002/2003 are no longer the "valid"
programming language. DDE *must* use WordBasic to communicate with Word
(any version), but WordBasic is no longer the "correct" automation
language for Word; VBA is. This will cause problems, will definitely be
slower, and in the long run will probably cease to work, as the
underlying structures change over time.

So, someone should probably start looking at "translating" this
functionality from DDE to OLE automation so that you're ready to
transition by the time you upgrade to the next version of Word.
Word 2000 (unlike Word 95)
has problems with big sets of documents. After composing about 500
documents, Word 2000 is not able to close document and open following.
Bookmark setting is performed on open document, but another operations
are not done (opening, closing, printing). (No errors reported by
Word.) I don't know if it is caused by implementation of wordbasic in
Word 2000 or by problems with DDE connections. I have to remark again,
that with Word 95 everything is fine.

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update Sep 30 2003)
http://www.word.mvps.org

This reply is posted in the Newsgroup; please post any follow question
or reply in the newsgroup and not by e-mail :)
 
S

Stefan German

Thanks for reply, Jay,
I will try to correct few wrong assumptions and bring discussion back
to the point I wanted to discuss. It's quite clear to me, that using
DDE (original DDE, not OLE) is not pretty way of document automation
nowadays, but it is something I have to live with.

I did not change anything in "data sending" application. I did not
change anything in word documents. I just started Word 2000 instead of
Word 97 and waited for result. Almost everything is fine, except
performance and problems of big data sets. As I wrote, I will try to
play with configuration of used PC, or change PC to solve problems. I
did not have time to do this by now.

To explain little more about word documents: They do not contain
macros. Only code within these documents is references (REF code) and
conditional references (IF code). That's all, nothing else.

I understand all pros of using newer scripting and interfacing Word
2000, but I cannot simply use them, because of "data sending"
application. It is programming language, but it is somehow closed and
old (8 years) and only way of data exchange is DDE. It can create DDE
connection and send data via DDE, send commands by DDE and close
connections. There are few more DDE commands, but after investigation
I can say, that they are useless for my purposes.

So, this is what I want: Force Word 2000 not to reformat whole
document after setting bookmark value (or inserting value into table).
Another thing is to clear Word's memory and buffers after each
document. I will play with DDE and connections to do this. I hope I'll
find something. Otherwise, without solution complete migration to Word
2000 is useless and we can wait for migration to new productive system
to be able to use it. ;-)

Thanks to all for all proposals and ideas.

Stefan.

Jay Freedman said:
Hi, Stefan,

This post opens a new question that wasn't mentioned in the thread before.
When you brought your application from Word 95 to Word 2000, did you do any
reprogramming to replace the old WordBasic code with the corresponding VBA
constructs? I'm guessing you did not, and that may account for some of the
problems you're seeing.

In Word 97 and later, VBA is the macro programming language. It contains a
"WordBasic object" that implements most of the old WordBasic functionality
from Word 95 and before, but it is *not* the same thing. You're going
through an extra layer of abstraction and interpretation. I don't know
specifically of any memory leaks or other problems in the WordBasic object,
but you may be stressing it more than most users.

Besides that, VBA has ways of doing things that were difficult or impossible
in WordBasic. For example, you can manipulate objects in a document --
paragraphs, tables, graphics, etc. -- without having to select them. There
are many new string and array functions. By using only what was available in
Word 95, you're probably losing an order of magnitude of speed.

If you need to process large numbers of documents using VBA -- that is, if
you can ever get away from DDE -- then you should plan on rewriting your
macros in native VBA. Of course, if you wait a couple of years, you'll
probably be able to go straight to VB.Net. ;-)

--
Regards,
Jay Freedman
Microsoft Word MVP

Stefan said:
Hi all.

Just confirming Cindy: I (our application) really cannot use VBA code
to communicate with Word. I will try to persuade our admins to spare
some time on reinstalling some machines. ;-)

I hope this will also help to solve another problem (which in final is
more disturbing than performance problems). Word 2000 (unlike Word 95)
has problems with big sets of documents. After composing about 500
documents, Word 2000 is not able to close document and open following.
Bookmark setting is performed on open document, but another operations
are not done (opening, closing, printing). (No errors reported by
Word.) I don't know if it is caused by implementation of wordbasic in
Word 2000 or by problems with DDE connections. I have to remark again,
that with Word 95 everything is fine.

I will have to investigate and study something about DDE connections
and go trough Microsoft's knowledge base.

Cindy M -WordMVP- said:
Hi Doug,

He can't use VBA code if the application is communicating
with Word via DDE. It's the DDE configuration on a
particular machine that's the problem.

That would be why it is so slow.

Use

With ActiveDocument
.Bookmarks("bm1name").Range.InsertBefore [text]
.Bookmarks("bm2name").Range.InsertBefore etc.


End With


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister (last update
Sep 30 2003)


This reply is posted in the Newsgroup; please post any
follow question or reply in the newsgroup and not by e-mail
:)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top