gojets1721
Registered User.
- Local time
- Today, 05:41
- Joined
- Jun 11, 2019
- Messages
- 430
Hello. Bit of a unique/challenging question. I have looked for some answers online but can't find anything. This might be a bit too specific of an issue.
I have a Hyperlink control in my form to allow users to drag a file from a File Explorer onto the control and it saves that file in a designated shared folder. It works great.
The issue is that it does not work if you drag a file attachment from Outlook. Nothing is added to the control. I use the below AfterUpdate code in the hyperlink control to achieve the above.
Any suggestions on if this can be tweaked to allow files to be dragged from Outlook?
	
	
	
		
 I have a Hyperlink control in my form to allow users to drag a file from a File Explorer onto the control and it saves that file in a designated shared folder. It works great.
The issue is that it does not work if you drag a file attachment from Outlook. Nothing is added to the control. I use the below AfterUpdate code in the hyperlink control to achieve the above.
Any suggestions on if this can be tweaked to allow files to be dragged from Outlook?
		Code:
	
	
	Private Sub txtHyperLinkIN_AfterUpdate()
    Dim strInPath As String
    Dim strFileName As String
    Dim strFileFolder As String
    Dim strOutPath As String
    Dim strReportNumber As String
    Dim strTempFileName As String
    Dim strFileExt As String
    
    DoCmd.SetWarnings False
    
    strFileFolder = "\Assets\Attachments\"  'specify the output folder
    
    strInPath = Me!txtHyperLinkIN.Hyperlink.Address
    
    strReportNumber = Me.ID
    strTempFileName = strReportNumber & " - " & Format(Now, "yyyymmddhhmmss")
    
    If Len(strInPath) > 0 Then
        strFileName = Right(strInPath, Len(strInPath) - InStrRev(strInPath, "\"))  'get the file name
        strFileExt = Right(strFileName, Len(strFileName) - InStrRev(strFileName, ".") + 1) ' get the file extension with dot
    
    'build the new path with output folder path and record number and date and extension
            strFileFolder = strFileFolder & strTempFileName & strFileExt
    
        FileCopy strInPath, strFileFolder
    
        Me!HyperLinkOUT = "#" & strFileFolder & "#"
        
End Sub 
	 
 
		 
						
					 
 
		