Message 1 of 25
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report
Hello.
I found this code written by Graham Harrison, but I cannot get it to run (comments are closed on his site):
oSketch = ThisDoc.Document.ComponentDefinition.Sketches("Sketch1") oTextbox = oSketch.TextBoxes(1) Dim sFormattedtext As String Dim theight As Single theight = TEXTHEIGHT theight = theight / 10 Dim tstart As Integer Dim tend As Integer Dim curtext As String tstart = InStr(oTextbox.Formattedtext, "'>") + 1 If tstart <> 1 Then tend = InStr(oTextbox.Formattedtext, "</Style") - 1 curtext = Mid(oTextbox.Formattedtext, tstart + 1, tend - tstart) Else curtext = oTextbox.Formattedtext End If sFormattedtext = "<StyleOverride FontSize='" & theight & "'>" & curtext sFormattedtext = sFormattedtext & "</StyleOverride>" oTextbox.Formattedtext = sFormattedtext
My sketch name and parameter match, but every time I run it, I get this error.
I have tested it on numerous parts, and the error is the same.
Of the many code offerings I have found here, this will give me what I need, if I can get it to work.
Any ideas why it will not run?
TIA
Solved! Go to Solution.