这个是转载 Word>Function ImageSize(fileName As String) As Variant ' Given a source file name (path to the GIF or JPG on disk), return an array containing ' the width (1st element) and height (2nd element). Dim retVal As Variant Dim header As String Dim f As Integer Dim wHi As Variant Dim wLo As Variant Dim hHi As Variant Dim hLo As Variant Dim w As Integer' width of image Dim h As Integer' height of image Dim foundMarker As Integer
Redim retVal(2) As Integer Redim retVal(Lbound(retVal)+1) ' Size it so there's 2 entries retVal(Lbound(retVal)) = 0 retVal(Ubound(retVal)) = 0