I am having a problem with the CorelScriptTools getFont calling up the windows font dialog. Everything seems to work great, except for the Italic Boolean says it is True, but when I test for it, it will not trigger either the false or true statements and goes right to the else statement, worse when I use it to trigger the Italic when creating artistic text, it produces just regular text.
Any help would be appreciated! The code is below!
Dim FontName$, PtSize&, Wt&, ItalicTxt As Boolean, underl As Boolean, StrkOut As BooleanDim myRed&, myGreen&, myBlue&, RegBold As Boolean
Sub SetFontVal()'you must set the corelscripttool as an object and then the other variablesDim cst As Object, ChsFont As Boolean, col As Boolean 'this sets the object to corel script tools Set cst = CorelScriptTools
'You need a boolean variable to access the corel script tools object 'in order to assign the variable using the windows font dialog ChsFont = cst.GetFont(FontName, PtSize, Wt, ItalicTxt, underl, StrkOut, myRed, myGreen, myBlue)
'Test for values MsgBox "Font Name: " & FontName & vbCrLf & "PtSize: " & PtSize & vbCrLf & "Wt: " & Wt & vbCrLf & "Italic: " & ItalicTxt & vbCrLf & _ "UnderL: " & underl & vbCrLf & "StrikeOut: " & StrkOut 'You need a boolean variable to access the corel script tools object 'in order to assign the variable using the windows color dialog col = cst.GetColor(myRed, myGreen, myBlue)
'converts a number to bold true or false If Wt < 700 Then RegBold = False 'lblBold.Caption = "No" MsgBox "Text is not bold" Else RegBold = True 'lblBold.Caption = "Yes" MsgBox "Text is bold" End If Select Case ItalicTxt
Case True 'lblItalic.Caption = "True" MsgBox "Italic is true!"
Case False 'lblItalic.Caption = "False" MsgBox "Italic is false!"
Case Else 'lblItalic.Caption = "Undefined" MsgBox "Italic is undefined!"
End Select Select Case underl Case True MsgBox "Underline is true!"
Case False MsgBox "Underline is false!"
Case Else MsgBox "Underline is Undefined!"
Select Case StrkOut Case True MsgBox "Strikeout is true!"
Case False MsgBox "Strikeout is false!"
Case Else MsgBox "Strikeout is Undefined!"
Set cst = Nothing End Sub
perhaps the selected font simply has no italics.
Besides, boolean variables have two values only, "true" and "false" and instructions after "Case Else" never will not be executed