Beiträge von JeffKelly

    OK.

    I have added this code to the OnClear event.

    Code
    rtEdit.NumberStyles.Clear;   rtEdit.NumberStyles.AddNumberStyle(       wp_bullet,       #183,       '',       'Symbol', // Font, important for bullets       750, // default indent       0, // Fontsize or default       false, // = legal numbering       0, // group, 1 for outline numbering       0  // level in group 1..10     );

    When I open the bullets dialog I see just the new bullet - this is good.

    But when I use the tool bar bullets button the bullet inserted into the document is the old one - this is bad.

    I need the new bullet to be inserted by default - the users do not want to have to use the bullet dialog to change formats.

    I tried to do this in the OnClear event

    Code
    rtEdit.NumberStyles.SelectedStyle := rtEdit.NumberStyles.Items[0];

    But this did not change the bullet inserted into the document.

    How can I change the bullet format first used by default in code?

    No, still not working.

    The RTF text produced looks like this.
    \pard\plain\plain\fs22\par
    \ls2\ilvl0{\listtext\f1 l\tab}\li1440\fi-360\plain\fs22\b{\field{\*\fldinst{MERGEFIELD "DATA TABLE StudPaperListACYR" <MOD_DELIM13>4<MOD_DELIM01>DATA TABLE StudPaperListACYR<MOD_DELIM25>MMEU3R1ZFBhcGVyTGlzdEFDWVI=<MOD_DELIM04>MMEaaj+JogAA<MOD_DELIM14>-1}}{\*\wpfldparam{DATA TABLE StudPaperListACYR}}{\fldrslt{110100 Introductory Accounting 0703 PNTH E
    \line 110109 Intro Financial Accounting 0703 PNTH E
    \line 199211 Invertebrate Zoology 0701 PNTH I
    \line 143227 Signals, Systems & Information 0702 PNTH I
    \line 199312 Behavioural Ecology 0702 PNTH I }}}\par
    \pard\plain\plain\fs22\par

    As you can see list formatting is not going into the fldrslt.
    I can put it there in code - if I can tell it should be there.

    Is this a possible solution? If so, can you tell me how I can tell that a bulleted list has been applied to the line of the merge field. I need to know this in the onMailMergeGetText.

    The adding of new bullets is working.
    But the setting of a new bullet to be the one that is first inserted when the bullet button on the tool bar is pressed is still a problem.

    I need this to work for every new document. The users want a standard bullet across the business. I was hoping that

    rtEdit.NumberStyles.SelectedStyle := rtEdit.NumberStyles.Items[1];

    would work after loading the new bullent in the OnClear event. Is there something like this?

    We are not using a global document template. I am not sure what this means, and was unable to find a reference to it in your pdf guide "WPToolsUpgrade.pdf".

    So in summary - can I change (in code) the bullet inserted when the bullets tool bar button is clicked for the first time in a new document?

    OK
    I have removed the rtf line breaks and replaced it with #13#10
    I have changed the code in onMailMergeGetText
    from
    //contents.Options := contents.Options + [mmMergeAsRTF] ;
    to
    contents.Options := contents.Options + [mmDontUseLoadedParStyle] ;

    The output now responds to bold, underline, italics and tab.
    But only the first row is bulleted or numbered.
    I still need to know how to get the bulleting to respond to the new lines in the list.

    I am using a TWPBulletDlg.

    I add a new bullet format to TWPBulletDlg and close the editor.
    I reopen and the format is lost.

    How can I make this format stay?
    How can I add formats that the users can see when first opening the dialog?
    How can I set a new default bullet for all users?

    OK I'll try to explain it again.
    We use WsTools in two ways
    1) Template Editor - allows uses to insert mail merge fields into text that look like
    <<StudentName>> or <<StudentPapers>>

    2) As a Letter Generator run against the database and the previously described template.
    <<StudentName>>is replacesd with Sid West in the mail merge event and the format that was applied to <<StudentName>> in the template applies to Sid West in the generated letter.

    The problem I have is when I try to replace <<StudentPapers>> with
    110 100 Accounting
    127 101 Maths
    127 207 Advanced Maths
    The users want to apply format to the template, such as bullet points or numbering or bold etc..
    When I resolve the mail merge field I get the rows from the database and concatenate them into a string with –

    while not dataSet.Eof do
    begin
    s := '';
    for i := 0 to pred(dataSet.FieldCount) do
    begin
    s := s + trim(dataSet.Fields[i].AsString) + ' ';
    end;
    result := result + ' \plain\fs22 ' + s + ' \par ';
    end;
    dataset.Next;
    end;

    and set this string into the letter with –
    contents.StringValue := My_List_of Papers;

    in the OnMailMergeGetText event

    This replaces the field <<StudentPapers>> with the list of papers. But
    if the field was bulleted only the first row of the list has bullet points.
    If the field was bold no rows of the list are bold.
    If the field was numbered only the first row is numbered.

    I have tried using TParagraphs but this adds a blank row above and below the list and the bullets still donot work. a single bullet appears on the first blank row. In this case the code per row from the database is
    par := rte.ActiveText.AppendPar;
    par.SetText(s);


    Can you help?

    Jeff

    Hi
    How can I set the format in a template for a mail merge field and have that show up.

    The field is a list of database rows. that I add ' \plain\fs22 ' + s + ' \par '; s being the row from the database.
    I have tried to use the TParagraph object as well which gives me an extra line top and bottom.

    What I want to be able to do is add a mailmerge field and set its format to bold or indented or bulleted in the template editor and for that format to be applied after the mail merge process.

    TIA Jeff

    I am trying to protect mailmerge fields from editing or deletion.
    I have set the following

    rtEdit.ProtectedProp := [ppIsInsertpoint,ppIsMergedText,ppProtectSelectedTextToo];

    The problem:
    The field can be dragged - the result is the field stays where it is and a copy is added at the drop point. So you then have two merge fields, neither one can be deleted.

    How can I stop the drag action doing a copy?
    I would be happy to prohibit the drag action if I knew how.
    I would be happy to allow the drag action if it actualy work properly.

    TIA
    Jeff

    Hi
    We are generating letters from templates on a remote server and storing the letters in a database.
    The user ,at a latter time, then opens the letter on their client machine for editing and dispatch.
    We need to hold in the letter a hidden property that can indercate if this is the first time the letter has been viewed.

    What could we use to hold hidden information in the letter.

    Hi
    We are generating letters from templates on a remote server and storing the letters in a database.
    The user ,at a latter time, then opens the letter on their client machine for editing and dispatch.
    We need to hold in the letter a hidden property that can indercate if this is the first time the letter has been viewed.

    What could we use to hold hidden information in the letter.