access trusted location folder

dal blog:  Access da zia Cin(zia) 

Private Sub Form_Load()
Dim shl
Dim strPath As String

Set shl = CreateObject("WScript.Shell")
If CurrentProject.Path <> shl.ExpandEnvironmentStrings("%USERPROFILE%Desktop") Then
      On Error Resume Next
      strPath = shl.RegRead(g_strKey)

       If strPath <> CurrentProject.Path Then
                        shl.RegWrite g_strKey, CurrentProject.Path
        End If
 End If
 Set shl = nothing
end sub
 

Nessun commento: