A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Adding attachment to message



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old April 21st 06, 07:12 PM posted to microsoft.public.outlook.program_addins
David Wendt
external usenet poster
 
Posts: 3
Default Adding attachment to message

I've seen examples of Add-in code which can create a new mail message and
add an attachment to it.

Is there a way to add an attachment to an email the user is currently
composing?

From the email editor (i.e. Word running from Outlook), I want to provide a
button which shows a dialog. When the user picks an item from the dialog I
want to create a local file and add that file as an attachment to the email
message the user is currently editing.

I'm familiar with writing Add-ins for Word and Outlook. I've been through
the forums and MSDN but cannot figure out how to do this.

--------------
David Wendt


Ads
  #2  
Old April 21st 06, 07:46 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Adding attachment to message

Application.ActiveInspector.CurrentItem.Attachment s.Add(...)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"David Wendt" wrote in message
...
I've seen examples of Add-in code which can create a new mail message and
add an attachment to it.

Is there a way to add an attachment to an email the user is currently
composing?

From the email editor (i.e. Word running from Outlook), I want to provide
a button which shows a dialog. When the user picks an item from the dialog
I want to create a local file and add that file as an attachment to the
email message the user is currently editing.

I'm familiar with writing Add-ins for Word and Outlook. I've been through
the forums and MSDN but cannot figure out how to do this.

--------------
David Wendt



  #3  
Old April 23rd 06, 03:53 AM posted to microsoft.public.outlook.program_addins
David Wendt
external usenet poster
 
Posts: 3
Default Adding attachment to message

OK, I see that but Word is my email editor so the Add-in button there would
not have access to the Outlook Application object (right?). Can I add a
button to the toolbar area of Word that Outlook occupies--the area with the
addresses, subject, and attachment controls?

-------------
David Wendt

"Dmitry Streblechenko" wrote in message
...
Application.ActiveInspector.CurrentItem.Attachment s.Add(...)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"David Wendt" wrote in message
...
I've seen examples of Add-in code which can create a new mail message and
add an attachment to it.

Is there a way to add an attachment to an email the user is currently
composing?

From the email editor (i.e. Word running from Outlook), I want to provide
a button which shows a dialog. When the user picks an item from the
dialog I want to create a local file and add that file as an attachment
to the email message the user is currently editing.

I'm familiar with writing Add-ins for Word and Outlook. I've been through
the forums and MSDN but cannot figure out how to do this.

--------------
David Wendt





  #4  
Old April 23rd 06, 06:16 PM posted to microsoft.public.outlook.program_addins
Rog
external usenet poster
 
Posts: 62
Default Adding attachment to message

Hi David, if your add-in is part of Outlook you will have access to the
Outlook Application object from the Connect class (if using .net).
You would just need to add a button to the new mail item inspector.
Thew button could open the form as you mentioned and once the user
selects the file, use the code Dmitry suggested in order to add the
attachment.
Rog

David Wendt wrote:
OK, I see that but Word is my email editor so the Add-in button there would
not have access to the Outlook Application object (right?). Can I add a
button to the toolbar area of Word that Outlook occupies--the area with the
addresses, subject, and attachment controls?

-------------
David Wendt

"Dmitry Streblechenko" wrote in message
...
Application.ActiveInspector.CurrentItem.Attachment s.Add(...)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"David Wendt" wrote in message
...
I've seen examples of Add-in code which can create a new mail message and
add an attachment to it.

Is there a way to add an attachment to an email the user is currently
composing?

From the email editor (i.e. Word running from Outlook), I want to provide
a button which shows a dialog. When the user picks an item from the
dialog I want to create a local file and add that file as an attachment
to the email message the user is currently editing.

I'm familiar with writing Add-ins for Word and Outlook. I've been through
the forums and MSDN but cannot figure out how to do this.

--------------
David Wendt




  #5  
Old April 24th 06, 05:13 AM posted to microsoft.public.outlook.program_addins
David Wendt
external usenet poster
 
Posts: 3
Default Adding attachment to message

Rog,
Thanks. The problem is that when Word is my email editor, I cannot seem to
add a button to it from my Outlook Add-in. The following is from MSDN:

"The Inspector Object and Microsoft Word as the User's E-mail Editor
If the user's default e-mail editor is Microsoft Word, and if the message
format of the item being edited is plain text or HTML, then no Inspector
object is associated with the item."

I verified this running in debug. I get an exception when trying to access
the Inspector of the mail item.

If I create a Word Add-in which shows a button in Word invoked as the email
editor, this add-in does not have access to the Outlook objects. Of course,
what I really want is to add the button to the email-editor-Word instance
from an Outlook Add-in. Or, I'd like to access the mail-item associated with
the email-editor-Word instance from a Word Add-in.

Any help getting around the 'no inspector' issue using Word as an email
editor?

David Wendt

"Rog" wrote in message
...
Hi David, if your add-in is part of Outlook you will have access to the
Outlook Application object from the Connect class (if using .net).
You would just need to add a button to the new mail item inspector.
Thew button could open the form as you mentioned and once the user selects
the file, use the code Dmitry suggested in order to add the attachment.
Rog

David Wendt wrote:
OK, I see that but Word is my email editor so the Add-in button there
would not have access to the Outlook Application object (right?). Can I
add a button to the toolbar area of Word that Outlook occupies--the area
with the addresses, subject, and attachment controls?

-------------
David Wendt

"Dmitry Streblechenko" wrote in message
...
Application.ActiveInspector.CurrentItem.Attachment s.Add(...)

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

"David Wendt" wrote in message
...
I've seen examples of Add-in code which can create a new mail message
and add an attachment to it.

Is there a way to add an attachment to an email the user is currently
composing?

From the email editor (i.e. Word running from Outlook), I want to
provide a button which shows a dialog. When the user picks an item from
the dialog I want to create a local file and add that file as an
attachment to the email message the user is currently editing.

I'm familiar with writing Add-ins for Word and Outlook. I've been
through the forums and MSDN but cannot figure out how to do this.

--------------
David Wendt




  #6  
Old April 24th 06, 03:28 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Adding attachment to message

You do get an Inspector and the NewInspector event from a WordMail item
being opened if you are using Outlook 2002 or later. Not for Outlook 2000 or
earlier. Not much you can do about that other than not support WordMail for
Outlook 2000.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"David Wendt" wrote in message
...
Rog,
Thanks. The problem is that when Word is my email editor, I cannot seem to
add a button to it from my Outlook Add-in. The following is from MSDN:

"The Inspector Object and Microsoft Word as the User's E-mail Editor
If the user's default e-mail editor is Microsoft Word, and if the message
format of the item being edited is plain text or HTML, then no Inspector
object is associated with the item."

I verified this running in debug. I get an exception when trying to access
the Inspector of the mail item.

If I create a Word Add-in which shows a button in Word invoked as the
email editor, this add-in does not have access to the Outlook objects. Of
course, what I really want is to add the button to the email-editor-Word
instance from an Outlook Add-in. Or, I'd like to access the mail-item
associated with the email-editor-Word instance from a Word Add-in.

Any help getting around the 'no inspector' issue using Word as an email
editor?

David Wendt


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
View message without loading attachment R E Bensow Outlook - Installation 3 April 12th 06 07:56 PM
Adding button to New Message Window Joshua Ellul Add-ins for Outlook 5 March 22nd 06 02:10 PM
adding an attachment to a new email goes into the body of the emai jannetta pincusi Outlook - Using Forms 1 February 15th 06 02:31 PM
When forwarding message with attachment, it is sent more than 18 t RobbertM Outlook Express 2 February 5th 06 03:46 AM
Troubles adding a macro to Mail Message - help please [email protected] Outlook and VBA 4 January 27th 06 12:01 AM


All times are GMT +1. The time now is 03:29 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.