Beiträge von Stef Merlijn

    Hi,

    I'm trying to setup the WPRichText to act like a HTML-editor.
    One of the things I need is: No limits on margins.

    Is there (or can you provide) an example which shows the optimal settings that are required for this purpose?

    I've tried setting properties "AsWebpage" to true, but it had no effect. So I guess some additional properties must also be changed.
    Maybe it would also be an idea to add setting up a HTML-editor to the usermanual.

    Thanks!

    Hi,

    Currently I insert a horizontal line as follows:
    If wpEmailEditor.Changing then
    begin
    wpEmailEditor.UndoBufferSaveTo(wpEmailEditor.ActivePar, wpuReplaceParTotal);
    wpEmailEditor.InputNewObject(wpobjHorizontalLine);
    wpEmailEditor.ChangeApplied;
    end;

    This inserts a thin line.
    How can I increase the thickness of this line?

    Would this be the correct code to update the hyperlink (replace the E-mailaddress)? Or is there a better way?

    Code
    procedure TFMailingPerEmail.BijwerkenAntwoordadresInUitschrijflink(vNewAntwoordadres : String);var i : Integer;    aList : TWPTextObjList ;begin  aList := TWPTextObjList.Create;  wpEmailEditor.TextObjectsGetList(aList, wpobjHyperlink, false);  for i := 0 to aList.Count-1 do  begin    if Pos(UpperCase('Unsubscribe by clicking here'), UpperCase(aList.Items[i].Source)) > 0 then    begin      wpEmailEditor.Changing;      wpEmailEditor.BeginUpdate;      aList.Items[i].Source := 'mailto:' + vNewAntwoordadres + '?Subject=UNSUBSCRIBE';      wpEmailEditor.EndUpdate;      wpEmailEditor.DelayedReformat;    end;  end;  aList.Free;end;


    By the way:
    Thanks for the suggestion about the hyperlink insertion. I've updated my code like:

    Code
    wpEmailEditor.Changing;
      wpEmailEditor.BeginUpdate;
      wpEmailEditor.InputHyperlink('Unsubscribe by clicking here','mailto:' + vAntwoordadres + '?Subject=UNSUBSCRIBE');
      wpEmailEditor.EndUpdate;
      wpEmailEditor.DelayedReformat;

    Hi,

    In the editor I add a hyperlink (unsubscribe link) using following code:

    Code
    vAntwoordadres := 'email@mydomain.com';  wpEmailEditor.Changing;  wpEmailEditor.BeginUpdate;  wpEmailEditor.UndoBufferSaveTo(wpEmailEditor.ActivePar, wpuReplaceParTotal);  par := wpEmailEditor.ActiveText.AppendNewPar();  wpEmailEditor.UndoBufferSaveTo(Par, wpuReplaceParTotal);  startobj := par.AppendNewObject(wpobjHyperlink,true,false);  par.Append('Unsubscribe by clicking here');  endobj   := par.AppendNewObject(wpobjHyperlink,true,true);hyperlink  endobj.SetTag(startobj.NewTag);  startobj.Source := 'mailto:' + vAntwoordadres + '?Subject=UNSUBSCRIBE';

    To check if this unsubscribe-link is present in the editor I use following code:

    Code
    function UnsubscribeLinkAvailable(Editor : TWPRichText) : Boolean;var i : Integer;    aList : TWPTextObjList ;begin  Result := False;  aList := TWPTextObjList.Create;  Editor.TextObjectsGetList(aList, wpobjHyperlink, false);  for i := 0 to aList.Count-1 do  begin    if Pos(UpperCase('?Subject=UNSUBSCRIBE'), UpperCase(aList.Items[i].Source)) > 0 then      Result := True;  end;  aList.Free;end;

    Now I need to update the vAntwoordadres (=Emailaddress) in the mailto: by code. Is there a way to accomplish this?

    Code
    if UnsubscribeLinkAvailable(FMailingPerEmail.wpEmailEditor) then
      begin
         // Update Emailaddress
         ????
      end;

    Hi,

    In the report a floating field can be inputed.
    Like:

    Code
    MailingEditor.InputMergeField(lbVeldenLijst.Items[lbVeldenLijst.ItemIndex], lbVeldenLijst.Items[lbVeldenLijst.ItemIndex]);

    In the database however this field can have a different number decimals per record.

    Is there a way to allow the end-user to format the inputmergefield to f.e. 2 decimals?

    Hi,

    Following code I use to insert a horizontal line, but the undo isn't triggered for it.

    Code
    procedure TFMailingPerEmail.mbHorizontaleLijnClick(Sender: TObject);
    begin
      If wpEmailEditor.Changing then
      begin
        wpEmailEditor.InputNewObject(wpobjHorizontalLine);
        wpEmailEditor.ChangeApplied;
      end;
    end;

    Any idea how to make this work?

    MailingEditor.InputString('My string',0);
    Adds a correct string with default Arial 10.

    Omiting the two procedures below didn't change the behaviour.
    I don't understand why it doesn't work anymore as it worked previously.

    I do use USEEXPRESSBARS;


    Code
    procedure TFMailings.GaNaarEindeMergeVeld;var MergeVeld : TWPTextObj;begin  // Naar het einde van een mergeveld gaan indien de cursor op een mergeveld staat.  MergeVeld := MailingEditor.FieldAtCP;  If (MergeVeld <> Nil) AND (MergeVeld.ParentPosInPar <> MailingEditor.ActivePosInPar) then  begin    MailingEditor.TextCursor.MoveTo(MergeVeld.EndTag);    MailingEditor.CPMoveNext;  end;end;procedure TFMailings.GaNaarEindeBookmarkVeld;var BookmarkVeld : TWPTextObj;begin  // Naar het einde van een bookmarkveld gaan indien de cursor op een bookmark staat.  BookmarkVeld := MailingEditor.BookmarkAtCP;  If (BookmarkVeld <> Nil) AND (BookmarkVeld.ParentPosInPar <> MailingEditor.ActivePosInPar) then  begin    MailingEditor.TextCursor.MoveTo(BookmarkVeld.EndTag);    MailingEditor.CPMoveNext;  end;end;


    Hi,

    I've installed version 6.20, but the problem remains.
    Below is my code I use to insert data into the editor. I seems everything is added with Arial 655.

    What could cause this?

    Well the cursor isn't moved at the moment the mergefield is added.

    Let's say that at the current cursor position the font=tahoma. Whenever a mergefield is added it is added as Arial with size 655.

    Any idea what might influence this behaviour?

    Hi,

    When I insert a mergefield the mergefield has font=Arial + fontsize=655, regardless of the current font+size under the cursor.

    Is there a way to make sure the mergefield get the currently active font+size (where the cursor currently is placed in the document)?

    Code
    WPRichText.InputMergeField(lbVeldenLijst.Items[lbVeldenLijst.ItemIndex], lbVeldenLijst.Items[lbVeldenLijst.ItemIndex]);

    In OnShow-event of the form:

    Code
    WPLocalizeLoadForms := TRUE;
      WPTools_LoadVCLStrings;
      WPTools_LoadActionStrings;
      mbLettertype.Items := Screen.Fonts;
      WPRichText.DefaultAttr.Clear;
      WPRichText.DefaultAttr.SetFontName('Arial');
      WPRichText.DefaultAttr.SetFontSize(10);
      WPRichText.WritingAttr.Clear;
      WPRichText.WriteObjectMode  := wobRTF;

    Hi,

    In my editor I add a mailto: link.
    Is the a way to check if there is already such a link present with combination of mailto: and UNSUBSCRIBE?