Problem with XP SP2

G

Guest

I ran the below program in a machine with XP SP1 and Word 2000 it took only 2
or 3 seconds to insert the bookmarks into the word document. But in a machine
with XP SP2 and Word 2000 it took 18 seconds in an average. I am using the
similar kind of program to insert the bookmarks into a letter at the runtime.

Could please anyone help me out.

Private Sub Command1_Click()
On Error GoTo err
Dim obj As New Word.Application
Dim bk As Bookmark
obj.Documents.Open "C:\Test\ObjA.dot"
obj.Visible = True
StartLog
SendToLog ("BookMark Insertion Starts")
For Each bk In obj.ActiveDocument.Bookmarks
If obj.ActiveDocument.Bookmarks.Exists(bk.Name) Then
obj.ActiveDocument.GoTo What:=wdGoToBookmark, Name:=bk.Name
obj.ActiveDocument.Bookmarks(bk.Name).Select
obj.Selection.InsertAfter bk.Name
obj.ActiveDocument.Bookmarks(bk.Name).Delete
End If
Next
SendToLog ("BookMark Insertion Ends")
EndLog
MsgBox "completed"

err:
Set obj = Nothing

End Sub
 
D

Dave B

Your assuming it has something to do with SP2, perhaps a post on the office
or word newsgroup would yield an answer.
 
G

Glen

You would need to run the program on the exact same computer not similar for
any time comparisons to be valid. I don't know the hardware or software on
the computers in question but unless they are identical it becomes
meaningless. Time it on the SP1 computer then install SP2 and rerun. I know
a 15 second difference seems like a lot but there could be a lot more going
on than SP2 slow down.
 

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

Similar Threads

Word Automation 2

Top