getting icon location
-
Hello.. all I used outlook to get the messages (mailItem) and then get the file attachments by calling mailItem.attachments.attachment So far no problem.. I got the attachment file name. still no error.. Here the problem come.. how to get the attachment icon?? I used the following code (SHGetFileInfo) to get the file attachment icon location so I can print the file attachment name with its associate icon on the paper ( same as printing from the printer) using HTML Code for example:
str = " "_ & aAttachment.Name
here is my code to get the icon location... This code doesn't work as I want ( I want to get the directory of the image of icon or attachment icon and put it in the html code)Dim loc As String 'Use this to get the small icon. Dim fName As String 'The file name to get the icon from. Dim shinfo As SHFILEINFO shinfo = New SHFILEINFO Dim openFileDialog1 As OpenFileDialog openFileDialog1 = New OpenFileDialog Dim hImgSmall As IntPtr 'The handle to the system image list. hImgSmall = SHGetFileInfo(aAttachment.Name, 0, shinfo, Marshal.SizeOf(shinfo), _ SHGFI_ICON Or SHGFI_SMALLICON) loc = " " & filename
Thank You