-
I used this code to save attachments inserted in an e-mail.
Dim out As Outlook.Application
Dim myItem As MailItem
Set out = CreateObject("outlook.application")
Set myItem = out.ActiveInspector.CurrentItem
myItem.attachments.Item(1).SaveAsFile PathAttachments
Then Message error is :
Object variable or with block variable not set!!!
What is happened????
Please help me!!!!!
-
I imagine you figured this out from the e-mail I sent you but just in case, remove the "as" and everything after it in each dim statement and you should be fine I think.
-
Actually, almost... need to add the Server object to the CreateObject too... Assuming your working in VBScript in ASP...
Code:
Dim out
Dim myItem
Set out = Server.CreateObject("outlook.application")
Set myItem = out.ActiveInspector.CurrentItem
myItem.attachments.Item(1).SaveAsFile PathAttachments
-
monte96:
Good point, but the way he explained the e-mails he sent I think he was using vbscript without any ASP.
-
That´s true. I just using VB 5.0 SP3