Announcements
Attention for Customers without Multi-Factor Authentication or Single Sign-On - OTP Verification rolls out April 2025. Read all about it here.
Rossco44
in reply to: A.Acheson

Thanks for all the help!

I did eventually come across some tucked away forum thread, turns out all i had to do was remove ".Style" from the oTextBox.Style.Color ahaha.
So that section looks like this now:

oFile = ThisApplication.Documents.Open(oDocument, True)
	
	'Create Job Number/Qty Text Box on the idw
	Dim oDrawDoc As DrawingDocument = ThisApplication.ActiveDocument
	Dim oSketch As DrawingSketch = oDrawDoc.ActiveSheet.Sketches.Add
	Dim oRed As Color = ThisApplication.TransientObjects.CreateColor(255, 0, 0)
	
	oSketch.Edit
	
	Dim oTG As TransientGeometry = ThisApplication.TransientGeometry
'	Dim sFormattedJB As String
	
	Dim StartOv As String = "<StyleOverride FontSize = '0.6' > "
	Dim EndOv As String = "</StyleOverride>	"
	Dim JBText As String =  jobNum & vbCrLf
	Dim QtyText As String = "QTY: " & Qty
	Dim oTextBox As Inventor.TextBox
	
	
	oTextBox = oSketch.TextBoxes.AddFitted(oTG.CreatePoint2d(10, 4), StartOv & JBText & QtyText & EndOv)
	oTextBox.Color = oRed
	
	
	oSketch.ExitEdit

 

We played around with the <StyleOverride> controls as well, but I imagine having just done oTextBox.FontSize = 0.8 would have worked too.
Thanks again.