Links to file (again)

Hi all,

Sorry for re-posting this topic…

I am looking for the easiest way to create a link to a file because I do not want to attach the file in the mail.

Indeed, we work on a lot of files (.doc, .xls, .ppt…) that are in shared directories.

I would like to allow users to put a link to their files (.doc, .xls…) rather than attaching the file … so as to reduce the weight of mails.

Is there any easy way ?

I tried to create a link or action zone but did not successed in. I would like to make it very simple for use (such as drag and drop with the question (do you want to : create a link or copy it ?").

The solution has to work for all kind of files (.doc, .xls, .ppt, .zip, … )

Thanks in advance for your help or advice

luc

Subject: links to file (again)

this is an modified solution I’ve found on OpenNTF:

  1. Create a field, where the user can specify the file (like ‘txMyPath’). You can create a hotspot-button ‘Choose File’ to let the user select the file:

@SetField(“txMyPath”;@Prompt([LocalBrowse];“Choose a file”;“”))

Add an additional hotspot button ‘Open File’ and place the following script into into declatation:

'<–from here into Declaration →

Const SEE_MASK_NOCLOSEPROCESS = &H40

Const SEE_MASK_FLAG_NO_UI = &H400

Private Type SHELLEXECUTEINFO

cbSize As Long

fMask As Long

hwnd As Long

lpVerb As String

lpFile As String

lpParameters As String

lpDirectory As String

nShow As Long

hInstApp As Long

lpIDList As Long

lpClass As String

hkeyClass As Long

dwHotKey As Long

hIcon As Long

hProcess As Long

End Type

Declare Function ShellExecuteEx Lib “shell32.dll”_

Alias “ShellExecuteEx” (SEI As SHELLEXECUTEINFO) As Long

Declare Function TerminateProcess Lib “kernel32”_

Alias “TerminateProcess” (Byval hProcess As Long, Byval uExitCode As Long) As Long

'<-- until here into declaration →

and now put the following code into ‘Click’

'<-- from here into Click →

Dim nws As New NotesUIWorkspace

Dim doc As NotesDocument

Dim SEI As SHELLEXECUTEINFO



Set doc = nws.CurrentDocument.Document

SEI.cbSize = Len(SEI)

SEI.fMask = SEE_MASK_NOCLOSEPROCESS Or SEE_MASK_FLAG_NO_UI

SEI.lpVerb = "open"

SEI.lpFile = doc.txMyPath(0) 'the full path must be specified!!!

SEI.nShow = 1

SEI.hInstApp = 0

SEI.lpIDList = 0



Call ShellExecuteEx(SEI)

'if it should be closed, unrem the following 2 lines

'Messagebox "Application opened."+Chr$(13) + "Click 'OK' to close the application", 0, "Success"

'Call TerminateProcess(SEI.hProcess, 0)

'<-- until here into Click →

If you followed my instructions, you should be able to set a path into a text field and open the specified file

Have fun!