Results 1 to 10 of 193

Thread: Appendix Thread 2. ( Codes for other Threads, HTML Tables, etc.)

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    As example, after running the macro in the last post , in the same worksheet, select cell D3 and run the macro below. Details of the file should be added.

    https://i.postimg.cc/g2y0C2qk/Versio...aker-files.jpg
    Version 2 simple property macro for Movie Maker files.jpg


    Code:
    ' Select top left of where File details should start, usually column D
    Private Sub FolderFileDetails()    '    https://www.youtube.com/watch?v=jTmVtPHtiTg&t=612s
    Dim Ws As Worksheet: Set Ws = Me
    Dim Parf As String
     Let Parf = ThisWorkbook.Path & "\Movie Maker"
    Dim objShell As Shell32.Shell: Set objShell = New Shell32.Shell  '    https://i.postimg.cc/Fz9zrnNm/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg     https://i.postimg.cc/sDC9S54h/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg
    Dim ObjFolder As Shell32.Folder: Set ObjFolder = objShell.Namespace(Parf)
    Dim Fil As Shell32.FolderItem
        For Each Fil In ObjFolder.Items
        Dim Clm As Long: Let Clm = Clm + 1
        Dim Rw As Long: Let Rw = 1
         Let ActiveCell.Offset(Rw, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 0)
         Let ActiveCell.Offset(Rw + 1, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 1)
         Let ActiveCell.Offset(Rw + 2, Clm - 1) = Replace(ObjFolder.GetDetailsOf(Fil, 2), "Anwendungserweiterung", "App Ext", 1, 1, vbBinaryCompare)
         Let ActiveCell.Offset(Rw + 3, Clm - 1) = Left(ObjFolder.GetDetailsOf(Fil, 3), InStr(1, ObjFolder.GetDetailsOf(Fil, 3), " ", vbBinaryCompare))
         Let ActiveCell.Offset(Rw + 4, Clm - 1) = Left(ObjFolder.GetDetailsOf(Fil, 4), InStr(1, ObjFolder.GetDetailsOf(Fil, 4), " ", vbBinaryCompare))
         Let ActiveCell.Offset(Rw + 5, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 31)
         Let ActiveCell.Offset(Rw + 6, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 57)
         Let ActiveCell.Offset(Rw + 7, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 164)
         Let ActiveCell.Offset(Rw + 8, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 165)
         Let ActiveCell.Offset(Rw + 9, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 166)
         Let ActiveCell.Offset(Rw + 10, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 309)
         Let ActiveCell.Offset(Rw + 11, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 311)
         Let ActiveCell.Offset(Rw + 12, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 312)
         Let ActiveCell.Offset(Rw + 13, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 313)
         Let ActiveCell.Offset(Rw + 14, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 314)
         Let ActiveCell.Offset(Rw + 15, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 315)
         Let ActiveCell.Offset(Rw + 16, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 316)
         Let ActiveCell.Offset(Rw + 17, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 317)
         Let ActiveCell.Offset(Rw + 18, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 309)
         Let ActiveCell.Offset(Rw + 19, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 319)
         Let ActiveCell.Offset(Rw + 20, Clm - 1) = ObjFolder.GetDetailsOf(Fil, 320)
        'Stop ' Stop after each file
        Next Fil
    End Sub
    


    Last edited by DocAElstein; 01-20-2024 at 10:18 PM.

  2. #2
    Fuhrer, Vierte Reich DocAElstein's Avatar
    Join Date
    Aug 2014
    Posts
    10,457
    Rep Power
    10
    Coding for this post:
    https://www.excelfox.com/forum/showt...age2#post23768

    Note: The global variable declarations, Dim Clm As Long, Reocopy As Long , must be included at the top of the code module, so that they workm independently of the macros using them. Otherwise if they were declared inside any macro they would be local to that macro and could not be accessed by different macros as we need them to be. Just to explain that again a bit differently. If for example the declaration was done inside the recursion / reoccurring macro, then there would be an independent one for each copy of the recursion / reoccurring macro. That would only be referenced to by the code lines like Reocopy = Reocopy + 1 , Reocopy = Reocopy – 1 , and Clm = Clm + 1 specific to that copy, and further more they would "vanish" at the end of any copy macro. So those sort of declared variables could not be used to keep a running total or continual copy number reference which we want.

    Code:
    Option Explicit
    Dim Clm As Long, Reocopy As Long ' variable for column number to put file or folder details in, number representin the copy of the second macro
    
    
    Sub PassFolderForReocursing2()
    'Sub SchellFolderDetails2() '  Jan 2024  https://www.excelfox.com/forum/showthread.php/2936-YouTube-Video-making-and-editing-etc-coupled-to-excelfox-(-windows-Movie-Maker-)/page2#post23775
    Rem 0
     Let Clm = 0: Reocopy = -1
    Rem 1
    Dim Ws As Worksheet: Set Ws = Me   '   G:\YouTubeVideos&Anaslysis&HackingTricks\VideoRecordingEditing\Windows (Live) Movie Maker\Movie Maker Versions.xls
    ' 1b
    Dim Parf As String
    ' Let Parf = ThisWorkbook.Path & "\Versions  Downloads Exes\Verson 2, 2 1 2 5 Downloads 2,1\50 Euro Keks"
    ' Let Parf = ThisWorkbook.Path & "\50 Euro Keks"
     Let Parf = ThisWorkbook.Path
    ' 1c
        If Len(Parf) - Len(Replace(Parf, "\", "", 1, -1, vbBinaryCompare)) >= 2 Then
         Let ActiveCell = Mid(Parf, InStrRev(Parf, "\", InStrRev(Parf, "\", -1, vbBinaryCompare) - 1, vbBinaryCompare))
        Else
         Let ActiveCell = Parf
        End If
    Rem 2  Windows Shell object
    Dim objShell As Shell32.Shell: Set objShell = New Shell32.Shell            '    https://i.postimg.cc/Fz9zrnNm/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg     https://i.postimg.cc/sDC9S54h/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg
    Dim objFolder As Shell32.Folder: Set objFolder = objShell.Namespace(Parf)  '
    Rem 3 Movie Maker Folder Property names and Property values.
    Dim Fil As Shell32.FolderItem
        For Each Fil In objFolder.Items  '  We loop through all items to find the Movie Maker folder ' =======
            If Fil.Name = "Movie Maker" Then
            Dim Rw As Long: Let Rw = 1
             'Let ActiveCell.Offset(Rw, 0) = "Name": Let ActiveCell.Offset(Rw, 1) = objFolder.GetDetailsOf(Fil, 0)
             Let ActiveCell.Offset(Rw, 0) = objFolder.GetDetailsOf("Goolies", 0): Let ActiveCell.Offset(Rw, 1) = objFolder.GetDetailsOf(Fil, 0)
             'Let ActiveCell.Offset(Rw + 1, 0) = "Größe": Let ActiveCell.Offset(Rw + 1, 1) = objFolder.GetDetailsOf(Fil, 1)
             Let ActiveCell.Offset(Rw + 1, 0) = objFolder.GetDetailsOf(71, 1): Let ActiveCell.Offset(Rw + 1, 1) = objFolder.GetDetailsOf(Fil, 1)
             'Let ActiveCell.Offset(Rw + 2, 0) = "Elementtyp": Let ActiveCell.Offset(Rw + 2, 1) = objFolder.GetDetailsOf(Fil, 2)
             Let ActiveCell.Offset(Rw + 2, 0) = objFolder.GetDetailsOf(Parf, 2): Let ActiveCell.Offset(Rw + 2, 1) = objFolder.GetDetailsOf(Fil, 2)
             'Let ActiveCell.Offset(Rw + 3, 0) = "Änderungsdatum": Let ActiveCell.Offset(Rw + 3, 1) = Left(objFolder.GetDetailsOf(Fil, 3), InStr(1, objFolder.GetDetailsOf(Fil, 3), " ", vbBinaryCompare))
             Let ActiveCell.Offset(Rw + 3, 0) = objFolder.GetDetailsOf(Ws, 3): Let ActiveCell.Offset(Rw + 3, 1) = Left(objFolder.GetDetailsOf(Fil, 3), InStr(1, objFolder.GetDetailsOf(Fil, 3), " ", vbBinaryCompare))
             'Let ActiveCell.Offset(Rw + 4, 0) = "Erstelldatum": Let ActiveCell.Offset(Rw + 4, 1) = Left(objFolder.GetDetailsOf(Fil, 4), InStr(1, objFolder.GetDetailsOf(Fil, 4), " ", vbBinaryCompare))
             Let ActiveCell.Offset(Rw + 4, 0) = objFolder.GetDetailsOf(Left("gh", 2), 4): Let ActiveCell.Offset(Rw + 4, 1) = Left(objFolder.GetDetailsOf(Fil, 4), InStr(1, objFolder.GetDetailsOf(Fil, 4), " ", vbBinaryCompare))
        '     Let ActiveCell.Offset(Rw + 9, 0) = "Dateiversion": Let ActiveCell.Offset(Rw + 9, 1) = objFolder.GetDetailsOf(Fil, 166)
             Let ActiveCell.Offset(Rw + 5, 0) = objFolder.GetDetailsOf("Bum", 166): Let ActiveCell.Offset(Rw + 5, 1) = objFolder.GetDetailsOf(Fil, 166)
            
             Rem 4
             ActiveCell.Offset(0, 2).Activate
             ' 4b
             Call ReoccurringFileFolderProps2(Parf & "\Movie Maker")
             Exit For ' Once we have passed on the full path of the folder,  Movie Maker  , then we are finished with this macro, so we don't need loop further looking fot the Movie Maker folder
            Else
            End If
        Next Fil ' ===========================================================================================
    End Sub
    
    '    https://www.excelfox.com/forum/showthread.php/2936-YouTube-Video-making-and-editing-etc-coupled-to-excelfox-(-windows-Movie-Maker-)/page2#post23774
    Private Sub ReoccurringFileFolderProps2(ByVal Pf As String)
    Rem 0
     Let Reocopy = Reocopy + 1 ' Originally the variable  Reocopy  is zero.  It will become 1 on first entering the macro.  Every time we leave this macro, this number is reduced by 1   So in simple use it will be 1 or zero indicating that a copy is in use.  However, should this macro "Call itself", before its finished , ( the recursion idea ) then the value will be 2  and so on.  So effectively it tells us which copy is running at any time
    Rem 1
    Dim objShell As Shell32.Shell: Set objShell = New Shell32.Shell            '    https://i.postimg.cc/Fz9zrnNm/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg     https://i.postimg.cc/sDC9S54h/Tools-Referrences-Microsoft-Shell-Controls-And-Automation.jpg
    Dim objFolder As Shell32.Folder: Set objFolder = objShell.Namespace(Pf)  '
    Rem 2
    Dim Fil As Shell32.FolderItem
        For Each Fil In objFolder.Items ' ======= Main Loop ==================================================|
        ' Dim Clm As Long: ' Global variable
         Let Clm = Clm + 1
        Dim Rw As Long: Let Rw = 1 + Reocopy + 1
             Let ActiveCell.Offset(Rw, Clm) = objFolder.GetDetailsOf(Fil, 0)
             Let ActiveCell.Offset(Rw + 1, Clm) = objFolder.GetDetailsOf(Fil, 1)
             Let ActiveCell.Offset(Rw + 2, Clm) = objFolder.GetDetailsOf(Fil, 2)
             Let ActiveCell.Offset(Rw + 3, Clm) = Left(objFolder.GetDetailsOf(Fil, 3), InStr(1, objFolder.GetDetailsOf(Fil, 3), " ", vbBinaryCompare))
             Let ActiveCell.Offset(Rw + 4, Clm) = Left(objFolder.GetDetailsOf(Fil, 4), InStr(1, objFolder.GetDetailsOf(Fil, 4), " ", vbBinaryCompare))
        '                                     Let ActiveCell.Offset(Rw + 9, 0) = "Dateiversion": Let ActiveCell.Offset(Rw + 9, 1) = objFolder.GetDetailsOf(Fil, 166)
             Let ActiveCell.Offset(Rw + 5, Clm) = objFolder.GetDetailsOf(Fil, 166)
            '_________________________________________________________________________________________________
            ' 2b  Here we may pause the macro, whilst another copy of it is started
            If objFolder.GetDetailsOf(Fil, 2) = "Dateiordner" Then Call ReoccurringFileFolderProps2(Pf & "\" & objFolder.GetDetailsOf(Fil, 0))
            '_________________________________________________________________________________________________
        '   If we did pause whilst the abobe code line set off another copy, then when that is finished we will come here and resume the paused previous copy
        Next Fil ' ============================== Main Loop  =================================================|
     
     
     Let Reocopy = Reocopy - 1  ' We are finished at this point with this running copy of the macro. (The next code line ends it). This code line here will reduce the value used to keep track of the  copy number being run
    End Sub

Similar Threads

  1. VBA to Reply All To Latest Email Thread
    By pkearney10 in forum Outlook Help
    Replies: 11
    Last Post: 12-22-2020, 11:15 PM
  2. Appendix Thread. Diet Protokol Coding Adaptions
    By DocAElstein in forum Test Area
    Replies: 6
    Last Post: 09-05-2019, 10:45 AM
  3. Replies: 19
    Last Post: 04-20-2019, 02:38 PM
  4. Search List of my codes
    By PcMax in forum Excel Help
    Replies: 6
    Last Post: 08-03-2014, 08:38 AM

Posting Permissions

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