J
Jason Logue
Hi, I am trying to run the following code and get an
object required error at the noted line. The following
code allows the user to enter a bookmark number into an
input box and the corresponding bookmark will be inserted
wherever the cursor is located.
Would anyone be able to tell me why I keep getting this
error?
TIA,
Jason
Public Sub PutBookmarkTextInDocument()
Dim strUserResponse As String
Dim strBookmarkName As String
strUserResponse = InputBox("Enter Exception
Number.", "Exception Number")
If VerifyUserInput(strUserResponse) Then
'We know we have a valid bookmark number. So put
it in the document
strBookmarkName = "Chapter" & Replace
(strUserResponse, ".", "_")
<<<Below is the line location where I get the error.>>>
'Put the bookmark text at the cursor
Selection.TypeText (source.Bookmarks
(strBookmarkName).Range)
End If
End Sub
object required error at the noted line. The following
code allows the user to enter a bookmark number into an
input box and the corresponding bookmark will be inserted
wherever the cursor is located.
Would anyone be able to tell me why I keep getting this
error?
TIA,
Jason
Public Sub PutBookmarkTextInDocument()
Dim strUserResponse As String
Dim strBookmarkName As String
strUserResponse = InputBox("Enter Exception
Number.", "Exception Number")
If VerifyUserInput(strUserResponse) Then
'We know we have a valid bookmark number. So put
it in the document
strBookmarkName = "Chapter" & Replace
(strUserResponse, ".", "_")
<<<Below is the line location where I get the error.>>>
'Put the bookmark text at the cursor
Selection.TypeText (source.Bookmarks
(strBookmarkName).Range)
End If
End Sub