I have form where I allow users to create mail merge letter templates. The form is basically a memo field that contains regular text and some merge codes which I later replace with data.
Example:
Dear <<FirstName>> <<LastName>>
I also have a popup form with a list of all the available merge codes. Users simply double click on the merge code the want to insert and then using the selstart and sellength properties of the memo field I can insert the merge code in the appropriate position. That all works great.
Now, using Access 07, I want to use rich text. The problem I am having is the the selstart and sellength properties return numbers based on the plain text, ignoring the html code. Thus the merge codes are being inserted in the wrong position.
Dear <<FirstName>> <<LastName>> in rich text format is:
<div><font face=Verdana>Dear <<FirstName>> <<LastName>></font> </div>
I could change the application and force users to copy and paste the codes into the appropriate position but I'd rather find a way to make it work as it is. Any suggestions?
Example:
Dear <<FirstName>> <<LastName>>
I also have a popup form with a list of all the available merge codes. Users simply double click on the merge code the want to insert and then using the selstart and sellength properties of the memo field I can insert the merge code in the appropriate position. That all works great.
Now, using Access 07, I want to use rich text. The problem I am having is the the selstart and sellength properties return numbers based on the plain text, ignoring the html code. Thus the merge codes are being inserted in the wrong position.
Dear <<FirstName>> <<LastName>> in rich text format is:
<div><font face=Verdana>Dear <<FirstName>> <<LastName>></font> </div>
I could change the application and force users to copy and paste the codes into the appropriate position but I'd rather find a way to make it work as it is. Any suggestions?