Browse through form displaying files of different types

jensthomsenjensthomsen Member Posts: 173
Well, I hope I can explain my problem in an understandable way...

Heres the deal:
I have a form displaying different files including paths like this:
c:\temp\file1.pdf
c:\temp\file2.txt
c:\temp\file3.docx

Now I want the following fuctionality: When activating a record (say 'c:\temp\file1.pdf') the file is opened with the right program/prompted for choosing a program. When choosing another record, the previously openede program+file is being closed, and the current file is being opened. And so on.

Does anyone knows wether this is possible without using strange automations?

Comments

  • ReinhardReinhard Member Posts: 249
    read about HYPERLINK in the Help (F1) you can use that to open basically any file.
    - Reinhard
  • SavatageSavatage Member Posts: 7,142
    Try This viewtopic.php?f=23&t=23783

    It looks like this - where you can add a name & a path.
    http://savatage99.googlepages.com/Cryst ... anksDe.doc

    The path uses common dialog for easy finding & saving. Click open to open the file in it's approriate program with the Hyperlink functionality
    in addition, so you don't have to manually type in the PATH just add
    Variable=CommonDlgMgt=type codeunit #412
    add to the On AssistEdit of the Path Field on the FORM!
    Path := CommonDlgMgt.OpenFile( FIELDCAPTION( Path), Path, 4, '*.*', 0);

    Thanks to Denster for the suggestion from this post. (2nd half)
    viewtopic.php?f=14&t=23298

    i can simplify the explanation if you need it.
  • jensthomsenjensthomsen Member Posts: 173
    Hello Savage
    Yes, its something like that I'm looking for, just a bit more automatic. I wan't the file to open and close when moving from record to record on the form (that is some code on "Form - OnActivateForm()"/"Form - OnDeActivateForm()"). But I'm not sure if is possible to close the open-file window from Navision, the "Common Dialog Management" codeunit only gives you function to open not closing??
  • matttraxmatttrax Member Posts: 2,309
    There is no way to close the file from Navision that I know of. Not without building something very complicated anyway.
  • SavatageSavatage Member Posts: 7,142
    as above says that would be something that would be a project if it can even be done.
    Clicking the red "X" to close is just something you might have to live with and it's not that big of a deal
Sign In or Register to comment.