8/29/2025 12:28:56 AM
|
|
slxdeveloper.com Community Forums |
|
|
|
The Forums on slxdeveloper.com are now retired. The forum archive will remain available for the time being. Thank you for your participation on slxdeveloper.com!
Forum to discuss writing script in Architect plugins for SalesLogix & general SalesLogix customization topics (for Windows client only). View the code of conduct for posting guidelines.
|
|
|
|
Attachments Tab opening up a Read Only attachment file. FSO File Copy
Posted: 04 Jun 09 12:37 PM
|
Sometimes you don't want users messing around with a signed customer contract....but you do want them to be able to review the document.....save it elsewhere, email it around, etc.
Thanks to RJ Ledger for the FSO stuff.
Sub OpenReadOnlyAttachment() Dim strDesc, strFileName Dim objFSO, objFileCopy Dim strSrcFile, strFileDestination
Dim AttachID AttachID = "" & grdAttach.GetCurrentField() IF AttachID = "" THEN EXIT SUB
strSrcFile = gStrAttachPath & grdAttach.GetCurrentField("FILENAME") '''''' "c:\yadda\aaa\file.xxx." strDesc = grdAttach.GetCurrentField("DESCRIPTION")
If DoesAttachmentExist(strSrcFile, strDesc, True) Then strFileName = RIGHT(grdAttach.GetCurrentField("FILENAME"), LEN(grdAttach.GetCurrentField("FILENAME")) - 13) strFileDestination = TRIM(SLX_TEMP_FolderPath & strFileName) ''''''' "c:\Temp\file.xxx." application.Debug.WriteLine strSrcFile & " " & strFileDestination
Set objFSO = CreateObject("Scripting.FileSystemObject") ' This code creates a temp folder if it does not already exist. If not objFSO.FolderExists(SLX_TEMP_FolderPath) Then objFSO.CreateFolder(SLX_TEMP_FolderPath) End If
'Get the File to copy Set objFileCopy = objFSO.GetFile(strSrcFile) 'Copy to destination objFileCopy.Copy(strFileDestination)
'Cleanup.. Set objFileCopy = Nothing Set objFSO = Nothing
' fire it off OpenSelectedFile strFileDestination, strDesc END IF End Sub
|
|
|
|
You can
subscribe to receive a daily forum digest in your
user profile. View the site code
of conduct for posting guidelines.
Forum RSS Feed - Subscribe to the forum RSS feed to keep on top of the latest forum activity!
|
|
|
|
|
|
|
|