-
the app send an email message but it won't attach a file to the email. Here is the code I am using to attach the file.
I don't know if I am using this right or not.
Dim objSession As MAPI.Session
Dim objMessage As MAPI.Message
'create a message and fill in its properties
Set objMessage = objSession.Outbox.Messages.Add
objMessage.Subject = txtSubject.Text
objMessage.Text = txtMessage.Text
objMessage.Attachments.Add "C:\file.dat"
-
Adding attachment
Hi ,
I think you should add the following code to your current code:
objMessage.Update
This is because you did something new to the current message
Michiel
-
operation failed
when I try and open the email doc I get the following error.
Can't Open this mail, the operation failed.
Clueless right know as to what the problem is
-
Opening Email
Can you be a little bit more specific?
-
objMessage.Attachments.Add "C:\file.dat"...is this the correct way?
i think it is like this..
objMessage.AttachmentIndex=0
objMessage.AttachmentName=somename 'as u wish
objMessage.AttachmentPathName=filepath
' if u want more
objMessage.AttachmentIndex=1
objMessage.AttachmentName=somename 'as u wish
objMessage.AttachmentPathName=filepath
Hope this helps
-
code don't work
I tried the example but she still broken, except know I am getting a runtime error, 486 - object does'nt support this method....
-
If u want I will send u a sample application that does this.
-
YEEESSS PLLEEEZZZ
-
This will work ..I think...
With objMessage.Attachments.Add
.Position = 1
.Type = mapiFileData
.Name = Attach 'name of attachment
.ReadFromFile Attach 'pathname
End With
-
Try this
Try the above code. Thats working on my machine. If I send u the whole application u will be confused. I think this is what u want. However if u really want just mail me
-
postion no...
what is the postion number for though???
-
Thats for setting where to put the attachment in the message. By the way is it working?
-
yep thank
Thank,
The code worked like a dream, one question though
where can i get my hand on a mapi tutorial.
-
You could find it on MSDN. I got it from there.