|
-
Oct 2nd, 2002, 11:22 AM
#1
Thread Starter
Fanatic Member
Object Attachment - James (Again ) *RESOLVED*
Using the MAPI controls I added
VB Code:
objAttachment.Position = 0
That kept the attachment from appearing on the mail message, it put it in the paperclip thingie in Outlook. So, my question is this, using the Outlook objects instead of MAPI (henceforth referred to as CRAPI MAPI), this method does not work (not supported) and without a line like this, the attached file shows up on the message itself with all my admin information. Is there another action that will keep the file from appearing inline and put it in the paperclip deal?
Thanks in advance.
Last edited by demotivater; Oct 2nd, 2002 at 12:16 PM.
-
Oct 2nd, 2002, 11:26 AM
#2
PowerPoster
Well
Dman, I'm stumped on this.
I will see if I can figure something out though. You want this for Outlook or Express?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 2nd, 2002, 11:31 AM
#3
PowerPoster
Well
More Info on attachments :
Using the Attachments Collection
Use the Attachments property to return the Attachments collection for any Outlook item (except notes).
Use the Add method to add an attachment to an item.
To ensure consistent results, always save an item before adding or removing objects in the Attachments collection of the item.
The following Visual Basic for Applications example creates a new mail message, attaches a Q496.xls as an attachment (not a link), and gives the attachment a descriptive caption.
VB Code:
Set myOlApp = CreateObject("Outlook.Application")
Set myItem = myOlApp.CreateItem(olMailItem)
myItem.Save
Set myAttachments = myItem.Attachments
myAttachments.Add "C:\My Documents\Q496.xls", _
olByValue, 1, "4th Quarter 1996 Results Chart"
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 2nd, 2002, 11:36 AM
#4
PowerPoster
Well
Perhaps this ?
Add Method (Attachments Collection)
Creates a new attachment in the Attachments collection, and returns the new attachment as an Attachment object.
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), or olEmbeddedItem(5).
Position Optional Long. The position of the attachment within the body text of the message.
DisplayName Optional String. The display name of the attachment. Ignored unless Type is set to olByValue.
Remarks
The following table describes the purpose of each OlAttachmentType constant value.
Constant Use to
olByReference Create a shortcut to an external file
olByValue Embed attachment in the item
olEmbeddedItem Create a shortcut to an Outlook item
When an Attachment is added to the Attachments collection of an item, the Type property of the Attachment will always return olOLE(6) until the item is saved.
To ensure consistent results, always save an item before adding or removing objects in the Attachments collection of the item.
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 2nd, 2002, 12:12 PM
#5
Thread Starter
Fanatic Member
OK -
I had this and couldn't get the position to work --
VB Code:
Set objAttachments = objNewMessage.Attachments
'add attachment per vendor
Select Case vendor
Case "Graybar"
objAttachments.Add ("\\fs-1\dump\graybar\archive\" & outFile)
Case "Rexel-United"
objAttachments.Add ("\\fs-1\dump\united\archive\" & outFile)
Case "French-Gerleman"
objAttachments.Add ("\\fs-1\dump\french\archive\" & outFile)
End Select
So, I changed it to the following and it works fine. *whew*
VB Code:
'add attachment per vendor
Select Case vendor
Case "Graybar"
source = ("\\fs-1\dump\graybar\archive\" & outFile)
Case "Rexel-United"
source = ("\\fs-1\dump\united\archive\" & outFile)
Case "French-Gerleman"
source = ("\\fs-1\dump\french\archive\" & outFile)
End Select
Set objAttachments = objNewMessage.Attachments.Add(source)
objAttachments.Position = 0
Thanks for the help, James!
-
Oct 2nd, 2002, 12:14 PM
#6
PowerPoster
Well
So it's resolved?
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
-
Oct 2nd, 2002, 12:15 PM
#7
Thread Starter
Fanatic Member
Yes, and dammit, I forgot to edit the subject line, doing it now.
-
Oct 2nd, 2002, 12:20 PM
#8
PowerPoster
Well
Glad you got it to work. Wasn't sure myself how to do it, until now...
Remaining quiet down here !!!
BRAD HAS GIVEN ME THE ULTIMATIVE. I have chosen to stay....
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
|