Beiträge von CBenac

    Hi,
    For years I've been using the code bellow to insert an image at the top of the document using WPRichText, but now I need to insert the image into a
    cell in a table, actually, the first column on the first row.
    How can i do that using as much as possible of the code bellow or if not, how?

    var par: TParagraph;
    FWPObj: TWPOImage; // Used to store the logotipo
    begin
    FWPObj := TWPOImage.Create(WPRichText1);
    FWPObj.Graphic := Image1.Picture.Graphic;
    FWPObj.WidthTW := FImgRight;
    FWPObj.HeightTW:= FImgBotton;
    WPRichText1.TextObjects.Insert(FWPObj);
    WPRichText1.Refresh();
    // Add blank space line
    par := AWP.ActiveText.AppendPar;
    par.SetText('');
    end;

    First I need to mention that the file in question is html and it will not resize the columns if opened by IE or Words.

    After using the SaveToLoad method for this file in question, WPRichText equally resizes all the columns regardless; however, if the SaveTofile method is called, the resulting file will not resize the columns if opened by IE or words. Thus, it is safe to assume that WPRichText does open and save the html file correctly. The problem is only the displaying in its body.

    Is there any way or workaround that will prevent WPRichText to resize the columns? This is very important (crucial) to me.

    Thanks

    if you created the table like in the example bellow:

    tbl := WPRichText1.TableAdd(nCols, nRows, [wptblActivateBorders], nil, nil);

    you can remove the [wptblActivateBorders] and use only [] instead.
    this will create a table without borders.

    tbl := WPRichText1.TableAdd(nCols, nRows, [], nil, nil);

    Otherwise you may try the following:

    WPBRD_NONE is a flag which is supported by RTF. If you don't want border remove all enable flags using

    ADel(WPAT_BorderFlags);

    HTH

    I'm using the code bellow to insert a paragraph at the top of a
    document after loading an external file. The problem is that the
    text always appears at the end and not at the top of the document

    WPRichText1.Clear;
    WPRichText1.CheckHasBody;
    WPRichText1.DefaultIOFormat := 'HTML';
    WPRichText1.TextLoadFormat := 'HTML';
    WPRichText1.TextSaveFormat := 'HTML';
    WPRichText1.LoadFromFile( 'C:\test.html');

    WPRichText1.CPPosition :=0;
    par := WPRichText1.InsertPar;
    par.SetText('TO:');

    OK. The code works perfectly now. Just need to know how to add a
    line inside the cell, without creating a new cell
    For example:

    FROM: Jim Smith
    1234 Main street


    I've tried CPMoveDownLine and CPMoveDownPar but both create another column in the table.

    Does anyone know if it is possible and, if yes, show an example on how to embed html code inside a cell?
    I need the following result:

    FROM: Jim Smith

    The "FROM" must be bold and "Jim Smith" don't.
    Currently, the only way I know to accomplish it is by creating 02 columns and setting its attributes. Then I remove the right border of the first column and the left border of the second. It appears OK in the WPRichText but if I save in HTML the columns are back in.

    Thank you

    Hope I'm not missing the point here, but if you are still looking for a function to format in code, you can use the Delphi FloatToStrF. The Format parameter gives you all the possible combinations you may need.

    The method ASet(WPAT_BorderType, WPBRD_NONE) does indeed remove the borders. However, if the file is saved as html the borders reappear (In the saved html file). Although this may be the normal behavior, I wonder if there is anyway to extend the method into the html file,i.e. the html file will also not have the borders.

    As I mentioned before, I use the WPEditor to create, edit , print , print then fax, and e-mail documents. Due to all this options, I was constantly having problems with margins It seems like every and each user out there have a different combination of "settings". So, the solution was to give the users an option to adjust the margins accordingly using the pagesetup component . The only thing is that the settings are stored in an ini file and automatically reloaded next time the user calls the same document. No more problems after this implementation. I also added a prompt telling the settings were changed and if he/she wants to make then permanentily.

    Regarding the e-mail components, I found one from http://www.marshallsoft.com. It is a DLL but I was able to send an e-mail with an image in-line in the position that I wanted it to show. I could never do that with Indy. I think it is possible but where are the demos?
    The DLL worked right away and I'm considering to buy it for US$105.00

    Does synapse has an example on how to accomplish the above?

    Yes, my application uses WPTools for originating e-mails.
    The good thing about is that the user can edit the e-mail as required.
    To send the e-mail, I use Indy components(Although they are not my favorites). Also, WPRichText allows to save the text as html thus you can store a copy of the e-mails sent. You can also load any html file in the editor, make any changes to the text, if needed, and e-mail it right away.
    HTH

    I load a document in WPRichText then I click "Select All" and change the
    entire font from its original, for example, "MS SansSeriff 8" to "Verdana 9". The text changes correctly (Both font and size).
    Then I used the SaveToFile method and when I call the RestoreTofile the font reverts back to its original "MS SansSeriff 8".

    Note 1: If I edit the text, the changes are saved and restored. The problem is only with the font and size.

    Note 2: If I change the font and size of only part of the document, it does save and restore properly. It appears that the problem is only when the entire document is selected.

    Thanks.

    I use WPRichText1 in HTML and it works great, but I really would like to know how to embed html code inside one column. The following code, for example,

    'simple text' + <b> + 'bold text' + '</b>'

    gives me the output:

    'simple text<b>boldtext</b>'

    I must be missing something but what?
    These are the settings used:
    WPRichText1.DefaultIOFormat := 'HTML';
    WPRichText1.TextLoadFormat := 'HTML';
    WPRichText1.TextSaveFormat := 'HTML';