Here's how you find and insert the replacement text for the ## token. You can use a similar method for the formatting tokens.
I'm going to start with the following assumptions:
1. Me!rtxText is a RichText control containing the data from the memo field. It could just as well be an ordinary text box or a string variable, for this example.
2. You want to replace the ## token with the text in a variable named strDepartment.
Code:
Dim i As Integer
i = InStr(Me!rtxText, "##")
If i <> 0 Then
Me!rtxText = Left$(Me!rtxText, i - 1) & strDepartment & Mid$(Me!rtxText, i + 2)
End If
The InStr() function sets i to the first occurrence of "##" in the data. i will either be 0, if "##" isn't found, or will be the index of the first "#", with 1 being the first character, etc.
The assignment statement then constructs a string consisting of the leftmost i-1 characters (i.e., the part of the string that precedes "##"

, the replacement text, and the right end of the string starting at the i+2 position. We use i+2 because i is the index of the first "#", and we want to extract the part of the string starting two characters to the right of it. This is a special use of the Mid$() function. Normally, you specify as arguments the string, the starting character index, and the length you want Mid$() to extract. But if you don't specify any length, Mid$() extracts all the characters to the end of the string.
If you just wanted to remove the "##" token, you would use the expression:
Code:
Left$(rtxText, i - 1) & Mid$(rtxText, i + 2)
I don't know what you plan to do with @b, @i, and @u. If you need to replace them with something, the same technique will work. If you instead need to use their positions in setting up RichText formatting, remember that you'll have to remove them, and when you do all the remaining text will shift left by 2 positions. So for each formatting token, the index of the text that follows it changes by -2.
Hope this helps.
Rick Sprague