Beiträge von Bobby

    Ok, I got that to work if the field is the very last thing on the line so that's a big help. Thanks.

    Now, how might you deal with it when it's not at the end of the line?

    for example:

    [mergefield] text text text [mergefield2] text2 text2 text2

    If you click between the mergfield2 and text2, it will fire.

    Is there another way to only make it come back true when clicking directly on the mergefield?

    Thanks for your help on this.

    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:

    Code
    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:

    Code
    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.

    Something I've finally figured out the source of...

    When editing a document with a linked image on a computer that does not have the linked image causes the document to be truncated. The image apears as a red outline in the document, but when the document is saved, the rtf is cut off. Adding the linked image to the local computer seems to fix the problem reliably. This was not a problem in v4 as sometimes we intentionally did not distribute the linked images.

    for example:

    Code
    {\headerf{\tblstart1{\trowd\trleft0\trftsWidth3\trwWidth10766\clftsWidth3\clwWidth4258\clvertalt\cel
     lx4258\clftsWidth3\clwWidth6508\clvertalt\cellx10766\pard\intbl\itap1\li0\fi0\ri0\sb0\sa0\ql\plain\f
     1\fs24\b{\*\wptools\wpomode0\wpoframe0{\*\wppicname{C:\\\\ProgramData\\\\image.jpg}}{\*\wppicsource{C:\\ProgramData\\
     image.jpg}}{\bin292

    at the end, there are a couple ASCII characters like blocks. Any ideas on what I can check if this might be something I'm doing? The images are inserted using the standard WPT image dlg.

    Seems to work ok using:

    Code
    DBWPRichText3.CodeMoveTo('jp',wpobjBookmark,[],[wpStartAtCursorPosition]);
    DBWPRichText3.CPPosition:= DBWPRichText3.CPPosition+1;
    DBWPRichText3.ReformatAll(False,True);
    DBWPRichText3.TextCursor.GetCharAttr;
    DBWPRichText3.ShowCursor;
    DBWPRichText3.SetFocus;

    Only thing is that for each execution it jumps into the first part of the bookmark then to immediately after the bookmark on the next press. The old way jumps to the beginning inside each bookmark with each press.

    Second, is there a way to make this go backward? I'm using CPMoveTo and CPMoveBack to do it now and it works exactly as I need, just doesn't work with nested bookmarks.

    Thanks for the help.

    I'm using this to jump between bookmarks in my document.

    It works fine like this as long as the bookmarks aren't nested.

    Is there a simple way to have it work in a situation like this? It should jump through them in order. Currently it would go from 1 to 4. I need 1-2-3-4.


    [Bookmark1]

    [Bookmark2]
    [/Bookmark2]

    [Bookmark3]
    [/Bookmark3]

    [/Bookmark1]

    [Bookmark4]
    [/Bookmark4]

    We've been having a problem occur randomly where adding a header or footer overwrites the entire document. That means all headers, footers, and the body are overwritten. This is done using the standard head/foot dialog.


    I can't give any more details than that at this time. But there it is, for your information.