Beiträge von KEN RANDALL

    Hi,

    I am using version 6.29.1 Premium with XE2 and I am having a problem when deleting merged text. This can be illustrated in the subject demo.

    1. Run the demo and open the biolife table.
    2. Switch to the Mailmerge Template tab and uncheck the ShowFields checkbox.
    3. Position the mouse to the right of the Category: Triggerfish field that has been merged and click.
    4. Now press the delete key. Nothing happens until you press the delete key again.

    Can you please tell me what I need to change to be able to edit replaced fields normally?

    I have purchased V7 but have not implemented it yet.

    Thanks,

    Ken Randall

    Hi,

    I am adding 2 styles:

    MyStyle:=WPRichText1.ParStyles.AddStyle('MYPLAIN');
    MyStyle.ASetFontName(EPDataModule.DefaultFontName);
    MyStyle.ASet(WPAT_CharFontSize,EPDataModule.DefaultFontSize*100);
    MyStyleBold:=WPRichText1.ParStyles.AddStyle('MYBOLD');
    MyStyleBold.ASetFontName(EPDataModule.DefaultFontName);
    MyStyleBold.ASet(WPAT_CharFontSize,EPDataModule.DefaultFontSize*100);
    MyStyleBold.ASetAddCharStyle(WPSTY_BOLD);

    And using the as follows:

    Par:=WPRichText1.ActiveText.AppendPar;
    Par.ABaseStyle:=MyStyleBold;
    etc.

    The screen looks fine and so does a print out but when I use:

    S:=WPRichText1.AsANSIString('HTML');

    and send this as an HTML email iI lose the bold bits. The HTML is incorrect as can be seen from below:

    <html>
    <head>
    <style><!--
    MYPLAIN{font-family:'Arial';font-size:9.00pt;}
    MYBOLD{font-family:'Arial';font-size:9.00pt;font-weight:bold;}
    div{font-family:'Arial';font-size:11.00pt;}

    --></style></head><body>
    <div class="MYPLAIN" style="font-family:'Arial';font-size:11.00pt;"><font face="Arial" size="3">&nbsp;</font></div>
    <div class="MYPLAIN" style="text-align:left;">&nbsp;</div>
    <div class="MYBOLD"><font face="Arial" size="2">Ken Clarke</font></div>
    <div class="MYPLAIN"><font face="Arial" size="2">Manager</font></div>
    <div class="MYPLAIN"><font face="Arial" size="2">Tonbridge Estate Agents</font></div>
    <div class="MYPLAIN"><font face="Arial" size="2">Tonbridge</font></div>
    </body></html>

    Any help greatly appreciated.

    Ken

    Hi,

    I'm sure this used to work. I'm using XE2 and WPTools Premium 6.28.

    In WPINC.INC I have:

    {.$DEFINE GRAPHICEX}
    {$DEFINE PNGIMG}

    In my app i use PngImage.

    My code is:

    WPRichText1.Changing;
    Img:=TWPOImage.Create(WPRichText1.Memo.RTFData);
    Img.LoadFromFile(whatever);
    WPRichText1.TextObjects.Insert(Img);
    WPRichText1.ChangeApplied;

    It works for a jpg but not for a png. I just get a blank image of the correct size.

    Any help greatly appreciated.

    Ken

    Hi,

    In one part of my application users can define a template letter's merge fields, static text, images, etc. and in another part use that template to generate and print the letter. The template is stored in a database.

    However, when users set a printer and paper tray in the template this information is not stored. How can I implement this?

    Ken

    Hi,

    The following doesn't work. Could you please tell me how best to do this?

    if (InspName=eapStrTodaysDateInFull) then
    begin
    DecodeDate(Date,Y,M,D);
    case D of
    1,21,31:S:='st';
    2,22:S:='nd';
    3,23:S:='rd';
    else
    S:='th';
    end;
    Contents.StringValue:='';
    Contents.MergePar.Append(IntToStr(D));
    Contents.MergePar.AppendChar(S[1],WPSTY_SUPERSCRIPT);
    Contents.MergePar.AppendChar(S[2],WPSTY_SUPERSCRIPT);
    Contents.MergePar.Append(' '+FormatDateTime('mmmm yyyy',Date));
    end else
    ...

    Thanks,

    Ken

    Hi,

    I am adding a an image using the following:

    Img:=TWPOImage.Create(WP2);
    Img.FileExtension:='JPG';
    Img.LoadFromStream(lStream);
    lStream.Free;
    Img.WidthTW:=Img.ContentsWidth;
    Img.HeightTW:=Img.ContentsHeight;
    Obj:=Cell.AppendNewObject(wpobjImage,false,false,0);
    Obj.ObjRef:=Img;

    How can I add a hyperlink to the image?

    Thanks,

    Ken

    Julian,

    Thanks. Turned out to be my mistake. I wasn't clearing a TMemoryStream before assigning to it so it was putting the small image at the end of where a large image was already.

    Thanks for your help.

    Ken

    Julian,

    Thanks. Basically I am doing the following to embed an image. It is a jpg 245 wide by 145 or so h using the following code:

    lStream:=TMemoryStream.Create;
    TBlobField(Query.FieldByName('Thumbnail')).SaveToStream(lStream);
    lStream.Position:=0;
    Img:=TWPOImage.Create(WP2);
    Img.FileExtension:='JPG';
    Img.LoadFromStream(lStream);
    lStream.Free;
    Img.WidthTW:=Img.ContentsWidth div 2;
    Img.HeightTW:=Img.ContentsHeight div 2;
    Obj:=Cell.AppendNewObject(wpobjImage,false,false,0);
    Obj.ObjRef:=Img;

    Then I store the document in a database using:

    Letter.TextSaveFormat:='RTF-nomergefields';
    lStream:=TMemoryStream.Create;
    Letter.SaveToStream(lStream);
    lStream.Position:=0;
    TBlobField(Tbl.FieldByName('Letter')).LoadFromStream(lStream);
    lStream.Free;

    The WriteObjectMode property is wobRTF .

    I will send the resultant RTF file to support.

    Ken

    I save mail-merged documents to a database and I have just noticed the large size of these documents. These are documents with JPG images but when they are saved the size of them goes from approx 20k to 1.5mb.

    Why is this?

    Ken