May 5, 201015 yr Hi, I'm trying to change the colour of text between two pre-defined tags. The tags are always the same - but the number of characters between will vary example 1: Some text which will be red and revert to master style. display: Some text which [color:red]will be red and revert to master style. example 2: Some other text change the colour and revert to master style. display: Some other text [color:red]change the colour and revert to master style. I was wondering how I count the characters and apply the correct text styling. I've searched but can't seem to crack this problem. I hope you can help, thanks David
May 5, 201015 yr Author Yes - the tags will be in pairs and . If we get into nesting tags these won't be used for display formating: I might end up with something like: Some text this will be red and back to original style I will then expect to see: Some text [color:red]this will be red and back to original style I can then substitute out the index tag markers in the display version. kind regards David
May 5, 201015 yr Try = Evaluate ( Substitute ( Quote ( Textfield ) ; [ "" ; Quote ( " & TextColor ( " ) ] ; [ "" ; Quote( " ; 16711680 ) & " ) ] ) )
May 5, 201015 yr Author I've just re-read your question. There may well be a requirement to have a number of tag pairs in a single field: some text which then has a second text selected. There may be yet another here....... I don't know how many instances there might be. In long articles there could be quite a few pairs. They would all have the same structure. David
May 6, 201015 yr Author Fantastic - that works wonderfully! Thank you very much. I've just got to limit my use of them otherwise everything will be turning red..... kind regards David
Create an account or sign in to comment