Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / June 2007

Tip: Looking for answers? Try searching our database.

Slow VBA in Word 2007

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Ken - 11 Jun 2007 00:11 GMT
I have a number of VBA routines that perform editing of Word
documents. Recently I installed Word 2007 only to find that the
routines run about 10 times slower so I carried out some tests. For
example:

Dim apara As Paragraph
Dim s As String
For Each apara In ActiveDocument.Range.Paragraphs
  apara.Range.Select
  s = apara.Style
Next apara

On a 900 paragraph document Word 2003 takes 2.03 seconds but in Word
2007 it takes 18.3 seconds. If the apara.Range.Select line is removed
then the times are .11 secs and .88 secs.

Tests of other VBA code show that W2007 is from 4 to 10 times slower
than W2003. I am using a duo-core with 2G of memory and running XP.

It is therefore impractical for me to use W2007 for editing and I only
use it if someone sends me a .docx file. However to switch from W2003
to W2007 and back takes about 5 minutes because W2007 re-installs each
time.

It seems to me that with Office 2007 Microsoft have created a lemon -
I have similar problems with Excel 2007.

Any comments?
Jay Freedman - 11 Jun 2007 02:37 GMT
Ken,

I can't speak personally for the difference in speed -- since I'm
running Office 2007 in a Virtual PC virtual machine, the comparisons
wouldn't be meaningful -- but there have been other posts that agree
with your results.

I don't have a solution for the speed problem, but you can solve the
problem of switching between versions. See Bob Buckland's post at
http://groups.google.com/group/microsoft.public.word.docmanagement/msg/ef3e95e0f
54ca3c5?hl=en
&
for instructions.

--
Regards,
Jay Freedman
Microsoft Word MVP        FAQ: http://word.mvps.org
Email cannot be acknowledged; please post all follow-ups to the
newsgroup so all may benefit.

>I have a number of VBA routines that perform editing of Word
>documents. Recently I installed Word 2007 only to find that the
[quoted text clipped - 24 lines]
>
>Any comments?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.