AnnTextEdit Example for Visual Basic
‘ This example programmatically makes an annotation text object
’ hObject go into edit mode
’ Note that hObject must be a text-based annotation
Private Sub ExampleAnnTextEdit_Click()
Dim nRet As Integer
Dim szError As String
Dim hObject As Long
RasterAnn.AnnCreate ANN_OBJECT_TEXT, True, True
hObject = RasterAnn.AnnObject
RasterAnn.AnnRectLeft(hObject) = 0
RasterAnn.AnnRectTop(hObject) = 0
RasterAnn.AnnRectWidth(hObject) = 100
RasterAnn.AnnRectHeight(hObject) = 100
nRet = RasterAnn.AnnTextEdit(hObject)
Select Case nRet
Case 0:
szError = ""
Case ERROR_AUTOMATION_INV_HANDLE:
szError = "AnnTextEdit failed because you are not in automated mode"
Case ERROR_INV_PARAMETER:
szError = "AnnTextEdit failed because hObject was not text-based"
Case Else:
szError = "AnnTextEdit failed"
End Select
If (szError <> "") Then
MsgBox (szError)
End If
End Sub