08-14-2017 09:56 AM
Hello,
Is there a way to programatically ensure that a comment text is only one line? I can populate a comment with a text from a channel property with Report.ActiveSheet.Objects.Item("CommentBox").Comment.Text = Data.Root.ChannelGroups("Channel").Properties("Desired_URL").Value. I am populating the comment box with a URL. This needs to be only one line since when it is exported to a PDF, it can only be clicked if it is one line. I was thinking of finding the number of characters in the url and then doing an if...elseif...else statement to conditionally change the font size of the comment. I'm not sure if this is possible with DIAdem, I'm having trouble finding the length of a text.
I was first trying to programatically change the contents of a free text since that will automatically change the font size, but this is not possible, so is there a way to have the font size automatically change to fit the comment box with hard coded dimensions?
08-15-2017 04:50 PM
You can find the length of a string by using the Len() function in VBScript. Does that help to implement your current strategy?
e.g.
dim StoredString StoredString = "this sentence is 36 characters long." MsgBox(Len(StoredString))
Should display a message box with the text "36".