Get Whether Note Contains Rich Embedded Text Example (VBA)
This example shows how to find out if a note contains rich embedded
text.
'-----------------------------------
'
' Preconditions: Model document is open and a note is
selected.
'
' Postconditions: None
'
'-----------------------------------
Option Explicit
Dim swApp As SldWorks.SldWorks
Dim swModelDoc As SldWorks.ModelDoc2
Dim swSelMgr As SldWorks.SelectionMgr
Dim swNote As SldWorks.Note
Dim swTextFormat As SldWorks.TextFormat
Dim swAnnotation As SldWorks.Annotation
Dim boolstatus As Boolean
Sub main()
Set swApp = Application.SldWorks
Set swModelDoc = swApp.ActiveDoc
Set swSelMgr = swModelDoc.SelectionManager
Set swNote = swSelMgr.GetSelectedObject6(1,
0)
Set swAnnotation = swNote.GetAnnotation
Set swTextFormat = swAnnotation.GetTextFormat(0)
boolstatus = swNote.HasMultipleFonts
Debug.Print "Does selected note have multiple fonts?
" & boolstatus
End Sub