Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Outlook / Programming Add-Ins / December 2005

Tip: Looking for answers? Try searching our database.

Detecting send as attachment from Word

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
jim_adams@hotmail.com - 28 Nov 2005 17:50 GMT
I've developed a VB6 COM add-in that displays on the new message
toolbar in Outlook 2003. However, its code does not
get called when a file is sent to a recipient as an attachment from
Word, probably since the resulting email window is in MAPI mode.

Is there a way for an Outlook COM add-in to be called in the above
scenario?

As it so happens <g>, I've also developed an extended MAPI add-in that
will display in the above scenario.

My problem is that I don't want both buttons displaying on the same
toolbar when messages are created from Outlook.

I've tried to have my COM add-in delete the extended MAPI button from
the Standard toolbar when it loads, but the extended MAPI button is the
only button that doesn't delete!

So then, I've tried to determine the parent window of my extended MAPI
button.  If it's Outlook don't show it since my COM button will work.
And if it's Word, show since I know the COM button won't show.  Sounds
good, but I can't find a way to detect whether Outlook's new message
window is spawned from Outlook or Word.

Grrrrrr.

Any help is greatly appreciated!!!

-Jim
Dave Kane [MVP - Outlook] - 30 Nov 2005 16:17 GMT
It sounds look your Outlook add-in is able to detect the ExMAPI button, it
just can't delete it. Is that correct? If so, why not have the COM add-in
check for the presence of your ExMAPI button when a new Inspector opens and
only add its own button if it doesn't find the ExMAPI button?

> I've developed a VB6 COM add-in that displays on the new message
> toolbar in Outlook 2003. However, its code does not
[quoted text clipped - 25 lines]
>
> -Jim
jim_adams@hotmail.com - 06 Dec 2005 17:20 GMT
Hi Dave,

That's a great suggestion.  However, the COM button has some
significant advantages over the extended MAPI version including

* position is controllable (next to Send) on standard toolbar (ExMAPI
is only at end)
* button includes text next to its icon
* VB6 code w/Outlook object model has proven more capable than ExMAPI
C++ version
* the strategic direction is to add more capabilties to the COM
version.

It's so close to being an ideal universal add-in... just one step away!

Thanks for your insight.

Jim

> It sounds look your Outlook add-in is able to detect the ExMAPI button, it
> just can't delete it. Is that correct? If so, why not have the COM add-in
[quoted text clipped - 30 lines]
> >
> > -Jim
PuppetMaster - 12 Dec 2005 11:42 GMT
Jim,

For the IDExtensibility methods, they have an array argument custom()
passed. In the _OnConnection function the element in custom(1) is an
integer that indicates how the COM addin was instantiated: 1 = Outlook;
<>1 = Other application eg Word.

I have now come across a slightly different problem with my own VB6
addin. When it initiates, I set up a listener on the Sent Items folder.
However, if I send a mail as an attachment from Word, whilst Outlook is
shutdown, the addin crashes as soon as I try and access the
objApp.GetNamespace("MAPI").Folders.GetFirst object. In fact anything
other than the objApp.GetNamespace("MAPI").Folders.Count property
fails! Any ideas??

Hope this helps!
Paul
jim_adams@hotmail.com - 12 Dec 2005 20:53 GMT
Hi Paul,

Thanks for the tip.  In my case, however, the exMAPI add-in will load
from Outlook and also from "Send as Attachment" from Word.  I don't
want it to load from Outlook since my more feature-rich COM button will
load then.

So I need to determine where the exMAPI button on the new message
window is loaded from, and not load if the parent is Outlook.

As for your issu with folders, I haven't had the reason to dabble in
that area so am not able to help out.  Sorry.

-Jim
jim_adams@hotmail.com - 15 Dec 2005 18:29 GMT
Hi Dave,

>From my response in this thread on Dec 12, 3:53 pm, do you have any
additional thoughts on this one?

Thanks,

Jim

> It sounds look your Outlook add-in is able to detect the ExMAPI button, it
> just can't delete it. Is that correct? If so, why not have the COM add-in
[quoted text clipped - 30 lines]
> >
> > -Jim
jim_adams@hotmail.com - 21 Dec 2005 20:28 GMT
Anyone have any further advice on this one?

Thanks,

Jim
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.