|
-
Nov 8th, 1999, 07:13 PM
#1
Thread Starter
Frenzied Member
I just tried to add .Attachments to an outlook object.
Can anyone tell me what the correect syntax is?
objOutlookMsg.Attachments = "C:\test.txt"
raises the error "One or more parameters are incorrect"
Thaks in advance etc.
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 8th, 1999, 08:01 PM
#2
Lively Member
Mark,
I think this is what you are after. I've not tested it, so you might have to tweak it slightly.
Code:
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
Set myAttachments = myItem.Attachments
myAttachments.Add "C:\Test.txt", _
olByValue, 1, "Test File"
-
Nov 8th, 1999, 08:12 PM
#3
Thread Starter
Frenzied Member
Thanks for that Ishamel!
------------------
Mark Sreeves
Analyst Programmer
[email protected]
A BMW Group Company
-
Nov 8th, 1999, 08:16 PM
#4
Lively Member
Here's what the help file has to say incase you need more info.
Syntax - objAttachments.Add(Source, [Type], [Position], [DisplayName])
objAttachments - Required. An expression that returns an Attachments collection object.
Source - Required Variant. The file (represented by the full path and file name) or item that constitutes the attachment.
Type - Optional Long. The type of attachment. Can be one of the following OlAttachmentType constants: olByReference(4), olByValue(1), olEmbeddedItem(5), or olOLE(6).
Position - Optional Long. The position of the attachment within the body text of the message.
DisplayName - Optional String. The display name of the attachment.
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|