S
sd
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
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