Index: cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.pas
===================================================================
--- cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.pas	(revision 541)
+++ cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.pas	(revision 654)
@@ -891,5 +891,5 @@
     KeyTime.HighPart := KeyPressTime.dwHighDateTime;
     Delta := floor( (NowTime2.QuadPart - KeyTime.QuadPart) / 100000);
-    Result := (Delta < 100);
+    Result := (Delta < 100) and (Delta > 0);
   end;
 
Index: cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.~pas
===================================================================
--- cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.~pas	(revision 541)
+++ cprs/branches/tmg-cprs/CPRS-Chart/TMG_Extra/HTMLEdit/TMGHTML2.~pas	(revision 654)
@@ -655,22 +655,26 @@
 
 function THtmlObj.MoveCaretToEnd : boolean;
-//kt added        
+//kt added
 var //TextRange:IHtmlTxtRange;
     count : integer;
 begin
+  if not assigned (FTMGDisplayPointer) then begin
+    Result := false;
+    exit;
+  end;
   Result:=(S_OK = FTMGDisplayPointer.MoveUnit(DISPLAY_MOVEUNIT_BottomOfWindow,0));
   count := 0;
-  repeat   
+  repeat
     Result:=(S_OK = FTMGDisplayPointer.MoveUnit(DISPLAY_MOVEUNIT_NextLine,-1));
     inc (count);
   until (Result = false) or (count > 500);
-  Result:=(S_OK = FTMGDisplayPointer.MoveUnit(DISPLAY_MOVEUNIT_CurrentLineEnd,0));   
+  Result:=(S_OK = FTMGDisplayPointer.MoveUnit(DISPLAY_MOVEUNIT_CurrentLineEnd,0));
   Result:=(S_OK = FCaret.MoveCaretToPointer(FTMGDisplayPointer,
                                             integer(FALSE),
                                             CARET_DIRECTION_SAME));
   {
-  SendMessage(FmsHTMLwinHandle, WM_KEYDOWN, VK_END, 0); 
+  SendMessage(FmsHTMLwinHandle, WM_KEYDOWN, VK_END, 0);
   SendMessage(FmsHTMLwinHandle, WM_KEYUP, VK_END, 0);
-  SendMessage(FmsHTMLwinHandle, WM_KEYDOWN, VK_END, 0); 
+  SendMessage(FmsHTMLwinHandle, WM_KEYDOWN, VK_END, 0);
   SendMessage(FmsHTMLwinHandle, WM_KEYUP, VK_END, 0);
   }
