C
cmonroe21 via OfficeKB.com
I am creating an OL2007 task and want to create my own attachment button. I
figured out that the user can select the "Insert" tab at the top of the
window and then has access to the paperclip attahcment button, and if I add
an email message body to the task then that's where the icons of the
attachments show up. This works fine, but I want to create my own attachment
button that will open up the standard attachment dialog box with folder
directory. I did some research and came up with this:
Dim instance As Attachments
Dim Source As Object
Dim Type As Object
Dim Position As Object
Dim DisplayName As Object
Dim returnValue As Attachment
returnValue = instance.Add(Source, Type, Position, DisplayName)
'(Have to add Microsoft.Office.Interop.Outlook namespace ??)
But I don't think this is exactly what I need... I just need to trigger the
attachment event, I think? And the dialog box with directory is part of that?
Any input would be greatly appreciated!
Also found this...
----------------------------------------------------
dim mail as emailMessage 'would change to task
dim file as emailAttachment
dim f as FolderItem
f = GetOpenFolderItem ("")
if f <> Nil then
file = new emailAttachment
file.loadFromFile f
mail.attachments.append file
end
'would this resemble code I could drop into a command button subroutine that
would bring up a file directory and let a user select an attachment, as the
standard attachment button does??
figured out that the user can select the "Insert" tab at the top of the
window and then has access to the paperclip attahcment button, and if I add
an email message body to the task then that's where the icons of the
attachments show up. This works fine, but I want to create my own attachment
button that will open up the standard attachment dialog box with folder
directory. I did some research and came up with this:
Dim instance As Attachments
Dim Source As Object
Dim Type As Object
Dim Position As Object
Dim DisplayName As Object
Dim returnValue As Attachment
returnValue = instance.Add(Source, Type, Position, DisplayName)
'(Have to add Microsoft.Office.Interop.Outlook namespace ??)
But I don't think this is exactly what I need... I just need to trigger the
attachment event, I think? And the dialog box with directory is part of that?
Any input would be greatly appreciated!
Also found this...
----------------------------------------------------
dim mail as emailMessage 'would change to task
dim file as emailAttachment
dim f as FolderItem
f = GetOpenFolderItem ("")
if f <> Nil then
file = new emailAttachment
file.loadFromFile f
mail.attachments.append file
end
'would this resemble code I could drop into a command button subroutine that
would bring up a file directory and let a user select an attachment, as the
standard attachment button does??