How to bring file information into a folder

Asked

Viewed 25 times

0

Hello I have to do a qualitative analysis of images that are on my site, I have all the files in a folder and I need to bring two information to Excel: File name and its dimensions. dimensões da imagem

  • Save, my dear! In what part of your code do you have any questions?

  • Hail to thee, Caesar! Some time ago I mounted a macro that lists all the files inside the folder and allows me to rename them, however I need that the part that lists the documents also bring this file size info, but I do not know how to do it, below Cód that lists the documents: https://gist.github.com/gutosantos1/27fb78be22a6dfde7a3c7d7c0c39ab16

1 answer

0

The two dimensions come together (probably there is a property that brings them separately), but I tested here with an image . jpg and got. Reference to the library Microsoft Shell Controls and Automations.

Function PegarDimensoes() as String

Dim sh As New Shell32.Shell
Dim arq As Shell32.FolderItem
Dim CaminhoPasta As String
Dim NomeArquivo As String

CaminhoPasta = "C:\Users\usuarioTal\Desktop\"
NomeArquivo = "gatos_sorriso.jpg"

Set arq = sh.Namespace(CaminhoPasta).Items.Item(NomeArquivo)
PegarDimensoes = arq.ExtendedProperty("dimensions")

End Sub

Browser other questions tagged

You are not signed in. Login or sign up in order to post.