Hello,
Ify ou want just to extract annotations, in addition to querying SQL, there are some APIs to work with data attachments. You can start exploring this one:
Dim objDataAttachmentList As DataAttachmentList = BRApi.Finance.Data.GetDataAttachments(si, memberScript, includeFileBytes, startRowIndex, pageSize). The last two params are optional.
You can use member script to define your perimeter.
The result object has propoerty Items which is a list of DataAttachment objects where you have the dimension member names, title, text, file if attached, etc. One of the properties of DataAttachment is AttachmentType.
So you could call the API, get the list and use Linq to filter VarianceExplanation ones using that property
Dim objDataAttachmentList As DataAttachmentList = BRApi.Finance.Data.GetDataAttachments(si, memberScript, includeFileBytes, startRowIndex, pageSize)
Dim listVarianceExplanation AS List(Of DataAttachment) = objDataAttachmentList.Items().Where(Function(x) x.DataAttachmentType = DataAttachmentType.VarianceExplanation).ToList()
Then you can operate with the list as you need.
Please use code above as starting point.
HTH