Hi Gurus,
I open a msg file saved on my hard drive, now in my VBA Application i want to read the full path of this file, is there any way of doing it through Outlook API?
Thanks
Rahul
Printable View
Hi Gurus,
I open a msg file saved on my hard drive, now in my VBA Application i want to read the full path of this file, is there any way of doing it through Outlook API?
Thanks
Rahul
What version of Outlook? If you saved a message to your file system, I'm not 100% sure you can
still get its path location using Outlook. You may need to use some APIs to get it file path.
Its outlook 2002, Yes i have saved the message into file system and want to read full path of this file in the startup event of Outlook.Application, which API's to use please suggest.
Thanks
Rahul
Here is an example using GetFullPathName.
VB Code:
Private Declare Function GetFullPathName Lib "kernel32" Alias "GetFullPathNameA" (ByVal lpFileName As String, ByVal nBufferLength As Long, ByVal lpBuffer As String, ByVal lpFilePart As String) As Long Private Sub Form_Load() 'KPD-Team 2000 'URL: [url]http://www.allapi.net/[/url] 'E-Mail: [email][email protected][/email] Dim Buffer As String, Ret As Long 'create a buffer Buffer = Space(255) 'copy the current directory to the buffer and append 'myfile.ext' Ret = GetFullPathName("myfile.ext", 255, Buffer, "") 'remove the unnecessary chr$(0)'s Buffer = Left(Buffer, Ret) 'show the result MsgBox Buffer End Sub
Thanks Guru,
Full File name is ok, How do i get the filename of opened msg file??
Please help
Thanks
Rahul
Once a msg is saved to the file system and opened from there, it is nothing more then a opened text file.
Why wouldnt you be able to do this from the other end? When you open the
file you would have to location then to use however you need.
Thanks Guru,
When the user double clicks on a msg file Outlook application is instiantiated, so i and i get Startup event in my addin code, now in this code i get the mailItem object, but not the msg file name/fulllname , this is my problem.
How do i get that ?
Help Guru
Thanks
Rahul
I dont see a way to get the msg file name/fulllname from an opened msg that is external to Outlook's MAPIFolders.
Why do you need this if its located in the file system? Perhaps there is another way to approach this?