I use this to determine if the user clicks on a merge field. In the old version, you had to click directly on the field for the event to come back true. In WPT5, if you click a line where the merge field is the last thing, it still comes back true, where it wouldn't before. For example, on a new line, put a merge field as the first thing on the line and nothing else. Click on the far right off the line, well away from the merge field and the event will still come back true.
How can I best emulate the previous function?
These are in the WPTRichText1.MouseUp event.
In WPT4, I had code like this:
var pa:PTAttr;begin pa:=WPRichText1.GetAttrAtXY(X,Y); if (afsAutomatic in ;a^.Style) or (afsIsInsertPoint in pa^.Style) then begin...
in WPT5 I'm dong this:
var
pa:TWPTextObj;
begin
pa := DBWPRichText3.FieldAtCP;
if ( ( pa <> nil ) and ( pa.ObjType=wpobjMergeField ) ) then begin
...
My only work around at this time is to manually place a blank space after the merge field. This stops it, but it's not really something I can expect my customers to do.