I am trying to access the View Label Defaults that are set in the Styles Manager using the API. I have looked through the Programming help and I found the following method that I believe is what I am looking for. The problem is, I dont understand how to use it. It wants me to pass it arguments which would make sense if I was trying to set the Defaults, but I am just trying to get the default FormattedText of the Labels.
DrawingStandardStyle.GetViewLabelDefaults Method DrawingStandardStyle.GetViewLabelDefaults( ViewType As DrawingViewTypeEnum, Prefix As String, Visible As Boolean, FormattedText As String,ConstrainToBorder As Boolean, PlaceBelowView As Boolean )
Any help would be greatly appreciated.
Thanks,
Solved! Go to Solution.
Solved by YuhanZhang. Go to Solution.
Only the first argument is input argument which you need to specify which kind of drawing view to get its view label defaults, and the others are output arguments and you need to define proper variables to receive them and then you can query their values after calling this method. Below is VBA sample:
Sub GetViewLabelDefaultsSample() Dim oDoc As DrawingDocument Set oDoc = ThisApplication.ActiveDocument Dim oStylesManager As DrawingStylesManager Set oStylesManager = oDoc.StylesManager Dim oStandard As DrawingStandardStyle Set oStandard = oStylesManager.ActiveStandardStyle ' Get the view label defaults for draft view Dim sPrefix As String, bVisible As Boolean, sFormattedText As String, bConstrainToBorder As Boolean, bPlaceBelowView As Boolean Call oStandard.GetViewLabelDefaults(kDraftDrawingViewType, sPrefix, bVisible, sFormattedText, bConstrainToBorder, bPlaceBelowView) Debug.Print "The prefix is: " & sPrefix Debug.Print "The formatted text is: " & sFormattedText End Sub
Hope this helps.