Jump to content

TextStyleAdd: How to limit to certain characters in a field.

This topic is 4394 days old. Please don't post here. Open a new topic instead.

Recommended Posts

I need some clarification on how TextStyleAdd works. I read this page already but it doesn't seem to function the way I'm understanding it described there. It says "TextStyleAdd(“Plaid”;Italic) returns the word Plaid in italics.", but it actually returns the word plaid and any other words following it in italics. So I guess I need to use additional functions to make it work on individual words but I'm not clear on how to do this.

Specifically, what I'm trying to do is create a price field that has the dollar and cent signs styled as superscript and no style on the numbers.

The original fragment of code I'm working with looks like this:

"$" & price ; price*100 & "¢"

First I tried this (only attempting to format the dollar sign):

TextStyleAdd ( "$" ; Superscript )  & price ; price*100 & "¢"

This makes the dollar sign and everything after it superscript. I experimented with TextStyleRemove on the following text but it didn't seem to have any effect. I tried only using it on the cent sign and that works fine - the issue only seems to happen to the text following the function. I did a search for TextStyleAdd on this forum and found several threads which seemed to have similar issues, but none of the examples worked for me.

Link to comment
Share on other sites

This topic is 4394 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

  • Create New...

Important Information

By using this site, you agree to our Terms of Use.