A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

show attachment file path as link in message body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old November 3rd 08, 12:53 PM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default show attachment file path as link in message body

hello
I've VSTO addin for Outlook 2007.I need to override the standard
behavior of drag and drop of attachments.
in message compose.Cancel the attachment add operation ,save the
attachment file in temp. folder & show
the file path as a link in message body.

I'm using below code
Private Sub CurrentMailItem_BeforeAttachmentAdd(ByVal Attachment As
Microsoft.Office.Interop.Outlook.Attachment, ByRef Cancel As Boolean)
Handles CurrentMailItem.BeforeAttachmentAdd

Dim strTmpFilePath As String
If bsent = True Then Exit Sub
strTmpFilePath =
System.IO.Path.Combine(System.IO.Path.GetTempPath, "Attachment")
strTmpFilePath = System.IO.Path.Combine(strTmpFilePath,
Attachment.FileName)
Try
Attachment.SaveAsFile(strTmpFilePath)
Catch ex As Exception
MsgBox(ex.Message)
End Try

CurrentMailItem.Body += gblSeparator & strTmpFilePath
Cancel=true
End Sub
The problem is that Message body doesn't show the filepath
(strTmpFilePath).When I checked body prop. through OutlookSpy,it
contains
the filepath but it is not reflected in message body.

Thanks in advance
Ads
  #2  
Old November 3rd 08, 02:05 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default show attachment file path as link in message body

Try saving the item.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sd" wrote in message
...
hello
I've VSTO addin for Outlook 2007.I need to override the standard
behavior of drag and drop of attachments.
in message compose.Cancel the attachment add operation ,save the
attachment file in temp. folder & show
the file path as a link in message body.

I'm using below code
Private Sub CurrentMailItem_BeforeAttachmentAdd(ByVal Attachment As
Microsoft.Office.Interop.Outlook.Attachment, ByRef Cancel As Boolean)
Handles CurrentMailItem.BeforeAttachmentAdd

Dim strTmpFilePath As String
If bsent = True Then Exit Sub
strTmpFilePath =
System.IO.Path.Combine(System.IO.Path.GetTempPath, "Attachment")
strTmpFilePath = System.IO.Path.Combine(strTmpFilePath,
Attachment.FileName)
Try
Attachment.SaveAsFile(strTmpFilePath)
Catch ex As Exception
MsgBox(ex.Message)
End Try

CurrentMailItem.Body += gblSeparator & strTmpFilePath
Cancel=true
End Sub
The problem is that Message body doesn't show the filepath
(strTmpFilePath).When I checked body prop. through OutlookSpy,it
contains
the filepath but it is not reflected in message body.

Thanks in advance


  #3  
Old November 4th 08, 11:03 AM posted to microsoft.public.outlook.program_addins
sd[_2_]
external usenet poster
 
Posts: 69
Default show attachment file path as link in message body

Thanks Ken ,But saving the item also doesn't refresh message body.Is
there any other way to show attachment file paths ( as I've saved them
in temp folder by cancelling outlooks BeforeAttachmentAdd event) in
message body?
  #4  
Old November 4th 08, 03:06 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default show attachment file path as link in message body

You can of course get the HTMLBody of an item and do string parsing looking
for a src: reference that refers to that attachment and then put whatever
text you want in the HTMLBody. The same could be done using Body for plain
text items.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"sd" wrote in message
...
Thanks Ken ,But saving the item also doesn't refresh message body.Is
there any other way to show attachment file paths ( as I've saved them
in temp folder by cancelling outlooks BeforeAttachmentAdd event) in
message body?


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Rule to auto reply using a dynamic text file as attachment or message body DF Outlook - General Queries 0 June 29th 07 06:38 PM
Before Send Email insert Attachment Path in Body Irene Outlook and VBA 4 February 1st 07 01:08 AM
change the cache mode path (.ost file path) bln-ami Outlook - Installation 0 July 18th 06 08:45 AM
Recieving a message with attachment and I can't view message body mytwosweetpeas Outlook - General Queries 0 July 7th 06 07:48 PM
Attachment does not show on header but in message body when create new email Johnny Chow Outlook - General Queries 2 January 30th 06 10:47 PM


All times are GMT +1. The time now is 08:53 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.