When you next ask a question please include as much detail as possible. It is very hard to help someone when they haven't provided vital details, i.e. "I have a document with inserted bookmarks" and "The document is created by a VB6 program"
The attached screenshot shows the difference between a collapsed and enclosing bookmark, and how to show bookmarks in your document.
If you have no control over the document and you know that the code is never more than 4 characters you can edit your code as follows:
Code:
Sub TestBookmark()
Dim rng As Range
Dim code As String
If ActiveDocument.Bookmarks.Exists("code") Then
Set rng = ActiveDocument.Bookmarks("code").Range
If rng.Start = rng.End Then
rng.MoveEnd wdCharacter, 4
code = rng.Text
Debug.Print code
Else
code = rng.Text
Debug.Print code
End If
Else
MsgBox "This bookmark doesn't exist" & vbCr & "code"
End If
End Sub