Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Open Outlook attachments through VB addin

Status
Not open for further replies.

redav

Programmer
Mar 20, 2001
55
0
0
GB
Hi

I'm creating an addin to open word documents on the event itemsend within outlook (See Code below)

How do I get the full path of the attachment as I only seem to be able to get the file name by using:-

(Item.Attachments.Item(1).FileName)



Private Sub objOLApp_ItemSend(ByVal Item As Object, Cancel As Boolean)

Set Item = objOLApp.ActiveInspector.CurrentItem

If Item.Attachments.Count > 0 Then

Dim wa As New Word.Application
Dim wd As Word.Document


Set wd = wa.Documents.Open(Item.Attachments.Item(1).FileName)

wa.Visible = True


End If
End Sub

Thanks
Redav
 
Have you tried the PathName property of the Attachment object ?
You may also consider the SaveAsFile method.

Hope This Helps, PH.
Want to get great answers to your Tek-Tips questions? Have a look at FAQ219-2884 or FAQ181-2886
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top