Consulting

Results 1 to 14 of 14

Thread: (Rule) save attachment then extract using 7zip

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Replace the CreateFolders process with the following which will write to UNC file paths:
    Private Sub CreateFolders(strPath As String)
    Dim lngPathSep As Long
    Dim lngPS As Long
        If Right(strPath, 1) <> "\" Then strPath = strPath & "\"
        lngPathSep = InStr(3, strPath, "\")
        If lngPathSep = 0 Then GoTo lbl_Exit
        Do
            lngPS = lngPathSep
            lngPathSep = InStr(lngPS + 1, strPath, "\")
            If lngPathSep = 0 Then Exit Do
            If Len(Dir(Left(strPath, lngPathSep), vbDirectory)) = 0 Then Exit Do
        Loop
        Do Until lngPathSep = 0
            MkDir Left(strPath, lngPathSep)
            lngPS = lngPathSep
            lngPathSep = InStr(lngPS + 1, strPath, "\")
        Loop
    lbl_Exit:
        Exit Sub
    End Sub
    Last edited by gmayor; 03-22-2016 at 02:21 AM.
    Graham Mayor - MS MVP (Word) 2002-2019
    Visit my web site for more programming tips and ready made processes
    http://www.gmayor.com

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •