Options

Edding Text to a MS Word Circular letter

MissesMagicMissesMagic Member Posts: 39
Hi all,

one question about MS Word, specific Circular letters...

I need to add some text to the document, but I´m not able to set it to the textarea.

The details:
I have created an template with some fields comming i.e. from Contact.
(for example look at "Segment"
Under this I want to type some text via code.
But when I open this document, the text is shown in one of the fields comming from Contact.
I have set a bookmark at the place I want the text to be shown, but he doesn´t find this.

Does anyone have solved such a problem?

Please help me
MM

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    I do not think that without customisations this is going to work.

    You can try using bookmarks and some additional coding to place the cursor at the bookmark and type the text there. Always works for me.
  • WaldoWaldo Member Posts: 3,412
    I could be wrong, but I think you're asking to put some text at an extra field when using the mailmerge, no?

    MOst of the work is done in codeunit 5054:
    For an extra field, you should add it in by:
    - Adding code in ExecuteMerge-function;
    - Adding code in ShowMergedDocument-function;
    - Adding code in CreateHeader-function;
    - Adding code in fctPrintMergedDocument-function;
    In all these functions, you find a bunch of Addfield functions. Just write similar code (all in the same order!) for adding you extra field.

    When added an extra field, this is how you can handle it to be able to put multiple lines in it:
    wrdMergefile.NewMultiField;
    WHILE NOT <your statement> DO BEGIN
     <GetNextPieceOfText>
      wrdMergefile.AddMultiToField(txtTextLine);
    END;
    wrdMergefile.EndMultiField;
    

    Hope this helps you ...

    Eric Wauters
    MVP - Microsoft Dynamics NAV
    My blog
Sign In or Register to comment.