Running Select 10
How can I via VBA find out the name of the text file in a current .dgn
I do know how to do manually by Element>Text Styles and see them , but can you use VBA to know there are styles loaded ?
Example: I know if they are there is a Style name DFS_250x250UL without manually looking is it possible to get VBA to check its existance
than if it was not the macro would import the .dgnlib which is named "DupontFontStyles.dgnlib"
Version: MicroStation V8i SS 10
RJB Phillips III (Richard) Praise the Lord for His Mercy and grace in Christ Jesus
Richard Phillips said:I put all that together as shown, but it will not run ?
If you copied all that into your own VBA project, it should run OK.
You need to call one of the methods in your code. Here's an example...
Public Sub Main () Dim styleName As String styleName = "DFS_250x250UL" Dim msg As String If TextStyleExists (styleName) Then msg = "Found text style '" & styleName & "'" ShowMessage msdMessageCenterPriorityInfo, msg, msg, False Else msg = "Text style '" & styleName & "' is not available" ShowMessage msdMessageCenterPriorityWarning, msg, msg, False EndIf End Sub
Usage...
vba run modMain.Main ' Where modMain is the name of your VBA module
Regards, Jon Summers LA Solutions
Jon thank you again, I copied the suggestion and when I ran I got the error message
'========================= ' Example from Jon Summers ' to botain if style exists '=========================== Public Sub Main() Dim styleName As String styleName = "DFS_250x250UL" Dim msg As String If TextStyleExists(styleName) Then msg = "Found text style '" & styleName & "'" ShowMessage msdMessageCenterPriorityInfo, msg, msg, False Else msg = "Text style '" & styleName & "' is not available" ShowMessage msdMessageCenterPriorityWarning, msg, msg, False End If End Sub