' Return the file type ' expC1 File name with the full path Public Function FileType(ByVal tcFile As String) As String Dim lcString As String = "" ' Read it as a binary lcString = FileToStrBinary(tcFile) ' If we have less than four characters If lcString.Length < 4 Then Return "" End If ' If this is a JPG If Left(lcString, 3) = Chr(255) + Chr(216) + Chr(255) Then Return "JPG" End If ' If this is a GIF If Left(lcString, 3) = "GIF" Then Return "GIF" End If ' If this is a EMF If Mid(lcString, 42, 3) = "EMF" Then Return "EMF" End If ' If this is a WMF If Left(lcString, 4) = Chr(215) + Chr(205) + Chr(198) + Chr(154) Then Return "WMF" End If ' If this is a TIF If Left(lcString, 4) = Chr(77) + Chr(77) + Chr(0) + Chr(42) Then Return "TIF" End If ' If this is a PNG If Left(lcString, 4) = Chr(137) + "PNG" Then Return "PNG" End If ' If this is a BMP If Left(lcString, 2) = "BM" Then Return "BMP" End If ' If this is a SWF If Left(lcString, 3) = "CWS" And Asc(Mid(lcString, 4, 1)) < 16 Then Return "SWF" End If ' If this is a SWF If Left(lcString, 3) = "FWS" And Asc(Mid(lcString, 4, 1)) < 16 Then Return "SWF" End If ' If this is a ZIP If Left(lcString, 4) = "PK" + Chr(3) + Chr(4) Then Return "ZIP" End If ' If this is a XML If UCase(Left(lcString, 6)) = "<?XML " Then Return "XML" End If ' If this is a DOC If Left(lcString, 8) = Chr(208) + Chr(207) + Chr(17) + Chr(224) + _ Chr(161) + Chr(177) + Chr(26) + Chr(225) Then Return "DOC" End If ' If this is a PDF If UCase(Left(lcString, 5)) = "%PDF-" Then Return "PDF" End If Return "" End FunctionI would like to fine tune it so it would also recognize DOCX and XLSX. Anyone knows the signature that would apply to those two?