Link information problem

DarkHorseDarkHorse Member Posts: 389
Hello, I want your help for a little thing. It turns out that we have a field called "Information" on, clicking, going to windows explorer and looks for a pdf we want to associate. This is the code in OnAssistEdit.

ocxFile.Filter :='*. pdf ';
ocxFile.DefaultExt :='*. pdf ';
ocxFile.ShowOpen;
IF (ocxFile.FileName <>'') THEN
"Information": = ocxFile.FileName;

Then we put a little button next to it does is open the pdf. that we have associated. The OnPush code is as follows:

IF ( "Information" <>'') THEN
HYPERLINK ( "Information")
ELSE
MESSAGE ( 'No data');

The problem is that if in "My Computer" I have no network folder as a unit where the information is doesn't opens the pdf. I wonder as I make link whom the information may do this by going to "My Network Places" / my domain / server main / folder (it can) but that they can access without having to open the network drive installed "My Computer".
May be is matter of the ocx, but I didn't put it and I don't know how it works.
Sorry if I have not explained well.
Thanks in advance

Comments

  • jannestigjannestig Member Posts: 1,000
    Wouldn't it solve the issue if the location was a mapped network drive that everyone had ?
  • DarkHorseDarkHorse Member Posts: 389
    Thanks for reply. You're correct, but we don't want that users have more units on "My computer", also don't want to browse the folder, but only access to the document.
    Thanks.
  • kapamaroukapamarou Member Posts: 1,152
    If I get it right:

    Declare: Var1 as Automation -> 'Windows Script Host Object Model'.FileSystemObject
    Declare: Var2 as Automation -> 'Windows Script Host Object Model'.Drive

    Then:

    Var2 := Var1.GetDrive('Z:\');//<-Your Drive Here
    MESSAGE(Var2.ShareName);

    This should get you started on how to make the path...
  • DarkHorseDarkHorse Member Posts: 389
    Thanks, but I don't want to put any drive, it should be something like \\servername I suppose.
    Thanks.
  • kapamaroukapamarou Member Posts: 1,152
    DarkHorse wrote:
    Thanks, but I don't want to put any drive, it should be something like \\servername I suppose.
    Thanks.
    From were do you get your "Information" variable?
  • DarkHorseDarkHorse Member Posts: 389
    The user who will put the information will go to the "Information" folder from the network to select the file. He will go to the path \\myserver\information\doc.pdf
    Thanks.
  • kapamaroukapamarou Member Posts: 1,152
    Is your scenario the following?
    A user selects a file and you store somewhere the filename in the form 'Z:\folder\file.ext'

    When another user tries to open the file it can't be found since the user does not have the same folder mapped.

    Have I understood the issue correctly?

    If so, then you should use my previous code to get the "real" folder location before storing it...

    Is this your case?
  • DarkHorseDarkHorse Member Posts: 389
    Correct; if the users don't have installed de folder in "My Computer" they can't access.
    I'll try your code then.

    Thanks for help.
Sign In or Register to comment.