Problem with XP SP2

  • Thread starter Thread starter Guest
  • Start date Start date
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
 
Your assuming it has something to do with SP2, perhaps a post on the office
or word newsgroup would yield an answer.
 
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.
 
Back
Top