Home | Forums | Contact | Search | Syndication  
 
 [login] [create account]   Friday, August 29, 2025 
 
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!
 Architect Forums - SalesLogix Scripting & Customization
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.
Forums RSS Feed


 Back to Forum List | Back to SalesLogix Scripting & Customization | New ThreadView:  Search:  
 Author  Thread: Attachments Tab opening up a Read Only attachment file. FSO File Copy
RJ Samp
Posts: 973
Top 10 forum poster: 973 posts
 
Attachments Tab opening up a Read Only attachment file. FSO File CopyYour last visit to this thread was on 1/1/1970 12:00:00 AM
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

[Reply][Quote]
 Page 1 of 1 
  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!
 

 
 slxdeveloper.com is brought to you courtesy of Ryan Farley & Customer FX Corporation.
 This site, and all contents herein, are Copyright © 2025 Customer FX Corporation. The information and opinions expressed here are not endorsed by Sage Software.

code of conduct | Subscribe to the slxdeveloper.com Latest Article RSS feed
   
 
page cache (param): 8/29/2025 1:04:06 AM