Opening files in Notepad

marvinqmarvinq Member Posts: 69
Hi,

I have stored a url for a text file in NAV. Now the question is, how can I in NAV open this file in windows notepad?

Thanks! :)

Comments

  • SavatageSavatage Member Posts: 7,142
    So when you click on the link which program is opening it? Word?

    You change the association for TXT types.
    http://windows.microsoft.com/en-US/wind ... by-default
  • marvinqmarvinq Member Posts: 69
    Thanks for replying

    Now I am using: HYPERLINK('[ur]'), and everything opens in Internet Explorer

    The thing is that the files are ".html" files, I want them to open in notepad so I can edit them, however in Windows I prefer that .html files open in IE.

    Other ideas?
  • SavatageSavatage Member Posts: 7,142
    The association post above still applies.

    Windows by default has HTML files open with Internet Explorer.
    See attached pic.

    I don;t know if it's a good idea to change the association of html files to notepad.
    Best to create a command button to notepad and from notepad open the file you want.
  • marvinqmarvinq Member Posts: 69
    Hi,

    It was much easier than I thought. There is an example in the NAV help-file on topic: SHELL
    OBJECT Codeunit 98123 SHELL ex
    {
      OBJECT-PROPERTIES
      {
        Date=30-08-04;
        Time=14:12:57;
        Modified=Yes;
        Version List=;
      }
      PROPERTIES
      {
        OnRun=BEGIN
                // The following is not trusted and will give a warning.
                ExecName := 'C:\windows\notepad.exe';
                param := 'C:\MyFile.txt';
                ret := SHELL(ExecName, param);
                // The following is trusted and will not give a warning.
                param := 'C:\MyFile.txt';
                ret := SHELL(TEXT000, param);
                // The following is not possible - will only give an error
                // message during runtime. This is also if its a TextConst:
                ExecName := 'C:\windows\notepad.exe C:\MyFile.txt';
                ret := SHELL(ExecName);
              END;
      }
      CODE
      {
        VAR
          ret@1000 : Integer;
          param@1001 : Text[30];
          TEXT000@1002 : TextConst 'ENU=C:\windows\notepad.exe';
          ExecName@1003 : Text[30];
        BEGIN
        END.
      }
    }
    

    ... and it works

    Thanks anyhow :)
Sign In or Register to comment.