HTML Editor

DenSterDenSter Member Posts: 8,307
Hello all,

Does anybody know if there's an HTML editor that I can use with Navision? My customer wants to write and store formatted (simple formatting, like bold, colors, etc) announcements in Navision that are then displayed in a control on a time entry website. I was thinking if I can link to an HTML editor that sends back the string including tags, I could just save that text string in Navision and display it in the web control.

Any help would be appreciated,
Daniel.

Answers

  • garakgarak Member Posts: 3,263
    My english not so good and i understand only the half, but you can, for expl. use word as html editor. The "String" can you get back.

    regards
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,307
    Do you have a code example?
  • garakgarak Member Posts: 3,263
    Must i create. I will take a look. I'ts true, that you only need the "Sting" :?:

    Like:

    <input type="button" class="button" accesskey="u" name="addbbcode4" value=" u " style="text-decoration: underline; width: 30px" onClick="bbstyle(4)" onMouseOver="helpline('u')" />

    regards
    Do you make it right, it works too!
  • garakgarak Member Posts: 3,263
    edited 2006-01-09
    Ok finished. If you realy need the String and the customer will not use WYSWYG Tool (like Frontpage, oh, you can also use frontpage :idea: ) here is an simple solution with MS Word.

    The Customer clicks on the Button in Form -> Word create, after them it comes an confirm (press ok When finished in WORD :!:, not before). Go to Word Insert into the rows your HTML-Code (like <a href = ..../a>). When finished, go to Navision press Ja, Yes, Ok on the ConfirmButton. The code from the rows will be insert in the table. Here the Code. I've tested with Word 2002 and it works fine. And you can use Word as editor for comments.
    First: table
    
    OBJECT Table 50005 testword
    {
      OBJECT-PROPERTIES
      {
        Date=09.01.06;
        Time=21:47:16;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
      }
      FIELDS
      {
        { 1   ;   ;Line                ;Integer        }
        { 2   ;   ;Text                ;Text250        }
      }
      KEYS
      {
        {    ;Line                                     }
      }
      CODE
      {
    
        BEGIN
        END.
      }
    }
    
    Now Form:
    
    OBJECT Form 50006 Testword
    {
      OBJECT-PROPERTIES
      {
        Date=09.01.06;
        Time=22:05:22;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        Width=9790;
        Height=6710;
        TableBoxID=1;
        SourceTable=Table50005;
      }
      CONTROLS
      {
        { 1   ;TableBox     ;220  ;220  ;9350 ;5500 ;HorzGlue=Both;
                                                     VertGlue=Both }
        { 2   ;TextBox      ;0    ;0    ;1700 ;0    ;ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Line }
        { 3   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=2;
                                                     InColumnHeading=Yes }
        { 4   ;TextBox      ;0    ;0    ;4400 ;0    ;HorzGlue=Both;
                                                     ParentControl=1;
                                                     InColumn=Yes;
                                                     SourceExpr=Text }
        { 5   ;Label        ;0    ;0    ;0    ;0    ;ParentControl=4;
                                                     InColumnHeading=Yes }
        { 8   ;CommandButton;7370 ;5940 ;2200 ;550  ;HorzGlue=Right;
                                                     VertGlue=Bottom;
                                                     PushAction=FormHelp }
        { 6   ;CommandButton;4950 ;5940 ;2200 ;550  ;OnPush=VAR
                                                              save@1000 : Boolean;
                                                              n@1001 : Integer;
                                                              name@1002 : Text[250];
                                                            BEGIN
                                                              CreateWord();
    
                                                              name := WordDocument.Name;
    
                                                              WordRange := WordDocument.Content;
                                                              WordTables := WordDocument.Tables;
    
                                                              //Tabelle erstellen
    
                                                              CreateNewTable(3,1);
    
                                                              WordTable := WordTables.Item(1);
    
                                                              IF NOT CONFIRM('šbernehmen?',TRUE) THEN
                                                                EXIT;
    
                                                              WordRows := WordTable.Rows;
    
                                                              FOR n := 1 TO WordRows.Count DO BEGIN
                                                                Line := n;
                                                                WordRange := WordTable.Cell(n,1).Range;
                                                                Text := DELSTR(WordRange.Text,(STRLEN(WordRange.Text) - 1),2);
                                                                INSERT;
                                                              END;
    
                                                              save := FALSE;
                                                              IF (WordDocuments.Count = 1) THEN
                                                                ClearWord(save)
                                                              ELSE BEGIN
                                                                FOR n := 1 TO WordDocuments.Count DO BEGIN
                                                                  IF (WordDocuments.Item(n).Name = name) THEN BEGIN
                                                                    WordDocuments.Item(n).Close(save);
                                                                    n := WordDocuments.Count + 1;
                                                                  END;
                                                                END;
                                                              END;
                                                            END;
                                                             }
      }
      CODE
      {
        VAR
          WordApp@1003 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{000209FF-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Application";
          WordDocuments@1002 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{0002096C-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Documents";
          WordDocument@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";
          WordSelection@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020975-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Selection";
          WordTables@1005 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{0002094D-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Tables";
          WordTable@1006 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020951-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Table";
          WordRows@1007 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{0002094C-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Rows";
          WordRange@1004 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{0002095E-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Range";
    
        PROCEDURE CreateWord@1();
        BEGIN
          //01 EXP - RKA +
          IF NOT ISCLEAR(WordApp) THEN
            CLEAR(WordApp);
          CREATE(WordApp);
          WordApp.Visible(TRUE);
          WordDocuments := WordApp.Documents;
          WordDocument := WordDocuments.Add();
          WordDocument.Activate;
          WordSelection := WordApp.Selection;
          //01 EXP - RKA -
        END;
    
        PROCEDURE ClearWord@1000000001(Save@1000000000 : Boolean);
        BEGIN
          //01 EXP - RKA +
          WordDocuments.Close(Save);
          WordApp.Quit(Save);
          CLEAR(WordApp);
          //01 EXP - RKA -
        END;
    
        PROCEDURE CreateNewTable@1000000010(Colums@1000000000 : Integer;Rows@1000000001 : Integer);
        VAR
          x@1000 : Integer;
          i@1001 : Integer;
        BEGIN
          //01 EXP - RKA +
          WordSelection.ParagraphFormat.SpaceBeforeAuto := 0; //0
          WordSelection.ParagraphFormat.SpaceAfterAuto := 0;  //0
          i := 1;
    
          x := 2;
          WordSelection.MoveRight(x,i);
          x := 4;
          WordSelection.MoveDown(x,i);
          x := 2;
    
          WordSelection := WordApp.Selection;
          WordRange := WordSelection.Range;
    
          WordSelection.Font.Name := 'Helvetica';
          WordSelection.Font.Size := 9;
    
          WordTable := WordTables.AddOld(WordRange,Colums,Rows);
          i := 1;
          //01 EXP - RKA -
        END;
    
        EVENT WordDocument@1001::New@4();
        BEGIN
        END;
    
        EVENT WordDocument@1001::Open@5();
        BEGIN
        END;
    
        EVENT WordDocument@1001::Close@6();
        BEGIN
        END;
    
        EVENT WordApp@1003::Quit@2();
        BEGIN
        END;
    
        EVENT WordApp@1003::DocumentChange@3();
        BEGIN
        END;
    
        EVENT WordApp@1003::DocumentOpen@4(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::DocumentBeforeClose@6(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::DocumentBeforePrint@7(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::DocumentBeforeSave@8(Doc@1002 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR SaveAsUI@1001 : Boolean;VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::NewDocument@9(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowActivate@10(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";Wn@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020962-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Window");
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowDeactivate@11(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";Wn@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020962-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Window");
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowSelectionChange@12(Sel@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020975-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Selection");
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowBeforeRightClick@13(Sel@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020975-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Selection";VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowBeforeDoubleClick@14(Sel@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020975-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Selection";VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::EPostagePropertyDialog@15(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::EPostageInsert@16(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeAfterMerge@17(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";DocResult@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeAfterRecordMerge@18(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeBeforeMerge@19(Doc@1003 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";StartRecord@1002 : Integer;EndRecord@1001 : Integer;VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeBeforeRecordMerge@20(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR Cancel@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeDataSourceLoad@21(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeDataSourceValidate@22(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR Handled@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeWizardSendToCustom@23(Doc@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document");
        BEGIN
        END;
    
        EVENT WordApp@1003::MailMergeWizardStateChange@24(Doc@1003 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";VAR FromState@1002 : Variant;VAR ToState@1001 : Variant;VAR Handled@1000 : Boolean);
        BEGIN
        END;
    
        EVENT WordApp@1003::WindowSize@25(Doc@1001 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020906-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Document";Wn@1000 : Automation "{00020905-0000-0000-C000-000000000046} 8.2:{00020962-0000-0000-C000-000000000046}:'Microsoft Word 10.0 Object Library'.Window");
        BEGIN
        END;
    
        BEGIN
        END.
      }
    }
    

    I hope it is this, what you need.

    regards
    Do you make it right, it works too!
  • ShenpenShenpen Member Posts: 386
    What about signing up for a free blog on blogger.com, editing WSIWYG there and when you like the looks than just go from "Compose" to "Edit HTML" and copy-paste into a text file via Notepad, save it and import it as a BLOB/BigText?

    Do It Yourself is they key. Standard code might work - your code surely works.
  • DenSterDenSter Member Posts: 8,307
    Thanks Garak, you're really putting in a lot of effort, I appreciate your help very much. I had to change the automation types to my version of Word, but it works very well. This is almost what I need. It would be perfect if I could format the text in WYSIWYG in Word, and that the string coming into Navision is the tagged html.

    So you'd see this in Word:
    This is bold. This is red. This is Italic

    And the string coming into Navision would be this:
    <p><b>This is bold</b>, <font color="#FF0000">this is Red</font>. <i>This is 
    Italic.</i></p>
    
    Then all I would need to do is set the web control's content to that string and it would display correctly.
  • DenSterDenSter Member Posts: 8,307
    I found a couple:
    http://freetextbox.com/
    http://cutesoft.net/example/general.aspx

    Neither one of them is automated (yet, and I don't know if I will need to do that), but they are simple WYSIWYG text editors with easy access to the marked up html.
  • garakgarak Member Posts: 3,263
    OK
    Do you make it right, it works too!
  • DenSterDenSter Member Posts: 8,307
    I would still be interested if you can get that Word component to work like that though :). In fact, that would make a pretty cool how-to.
  • jhoekjhoek Member Posts: 216
    ...apart from the quality of the HTML generated by Word, that is... Frontpage is way better equipped for this job, I'd say.
    Kind regards,

    Jan Hoek
    Product Developer
    Mprise Products B.V.
  • garakgarak Member Posts: 3,263
    Instead of word, its better you use the Frontpage - Automations.

    regards
    Do you make it right, it works too!
Sign In or Register to comment.