PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
how to detect programmatically if some code is runing in wordmail
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
how to detect programmatically if some code is runing in wordmail
![]() |
how to detect programmatically if some code is runing in wordmail |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi dear all,
I have some code running in a com add-in with a Word connector , and I would like to know from this code if the word application instance running the dll code is a standalone word application or a wordmail instance. if it is a wordmail instance , I would like to be able from the routine to send the mail from the current outlook inspector. How can I achieve this ? Any sample code is much appreciated Best regards |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Window.EnvelopeVisible = True tells you that it's a WordMail item.
Offhand I don't know of a way to get from that Word window back to the specific Outlook Inspector directly. You could iterate the Outlook.Inspectors collection and look for the Caption of each Inspector window and compare it to the caption of the Word window. That wouldn't work however until the first Inspector.Activate event had fired already. You could get the class name of the Word window from the Win32 API and then look for all open classes in Windows to match the class id. You could look for a class of "OpusApp". -- 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 "Herve cadieu" <Hervecadieu@discussions.microsoft.com> wrote in message news:CAA0A8F0-61A7-4DBB-A08A-214A72E13707@microsoft.com... > Hi dear all, > I have some code running in a com add-in with a Word connector , and I > would > like to know from this code if the word application instance running the > dll > code is a standalone word application or a wordmail instance. > > if it is a wordmail instance , I would like to be able from the routine to > send the mail from the current outlook inspector. How can I achieve this ? > > Any sample code is much appreciated > Best regards |
|
|
|
#3 |
|
Guest
Posts: n/a
|
First of all Thank you much for your kind answer Ken,
Thank you much for the first point according to window.envelopeVisible=true The second point is still not clear to me , could you show me a little snippet ? thank you much ken "Ken Slovak - [MVP - Outlook]" wrote: > Window.EnvelopeVisible = True tells you that it's a WordMail item. > > Offhand I don't know of a way to get from that Word window back to the > specific Outlook Inspector directly. You could iterate the > Outlook.Inspectors collection and look for the Caption of each Inspector > window and compare it to the caption of the Word window. That wouldn't work > however until the first Inspector.Activate event had fired already. > > You could get the class name of the Word window from the Win32 API and then > look for all open classes in Windows to match the class id. You could look > for a class of "OpusApp". > > -- > 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 > > > "Herve cadieu" <Hervecadieu@discussions.microsoft.com> wrote in message > news:CAA0A8F0-61A7-4DBB-A08A-214A72E13707@microsoft.com... > > Hi dear all, > > I have some code running in a com add-in with a Word connector , and I > > would > > like to know from this code if the word application instance running the > > dll > > code is a standalone word application or a wordmail instance. > > > > if it is a wordmail instance , I would like to be able from the routine to > > send the mail from the current outlook inspector. How can I achieve this ? > > > > Any sample code is much appreciated > > Best regards > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
You could get the Word Window.Caption since you have your Word code. Then
you could get the Outlook Inspectors collection and iterate it. For each Inspector check Inspector.Caption and see if they match. If so that most likely is the WordMail window. An alternative is to use FindWindow in the Win32 API to get the window with that caption, then you can use GetClassName to verify that it's "OpusApp" to make sure it's a WordMail window. -- 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 "Herve cadieu" <Hervecadieu@discussions.microsoft.com> wrote in message news:AE4B3DD0-96A5-4E8F-A36A-17ED6FE51D81@microsoft.com... > First of all Thank you much for your kind answer Ken, > Thank you much for the first point according to > window.envelopeVisible=true > > The second point is still not clear to me , could you show me a little > snippet ? > > thank you much ken |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Thanks Ken,
From that when I get the right inspector item in outlook , what piece code is needed to send the said email after checking that I ghave at least one recipient filled ? "Ken Slovak - [MVP - Outlook]" wrote: > You could get the Word Window.Caption since you have your Word code. Then > you could get the Outlook Inspectors collection and iterate it. For each > Inspector check Inspector.Caption and see if they match. If so that most > likely is the WordMail window. > > An alternative is to use FindWindow in the Win32 API to get the window with > that caption, then you can use GetClassName to verify that it's "OpusApp" to > make sure it's a WordMail window. > > -- > 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 > > > "Herve cadieu" <Hervecadieu@discussions.microsoft.com> wrote in message > news:AE4B3DD0-96A5-4E8F-A36A-17ED6FE51D81@microsoft.com... > > First of all Thank you much for your kind answer Ken, > > Thank you much for the first point according to > > window.envelopeVisible=true > > > > The second point is still not clear to me , could you show me a little > > snippet ? > > > > thank you much ken > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Item.Send. Use the Object Browser to check for all methods, events and
properties. That would bring up the security prompts unless this is a trusted COM addin however. Outlook 2003 will trust a correctly written COM addin (you derive your Outlook application object from the Application object passed in On_Connection and all Outlook objects from that Application object). Earlier versions require use of the Exchange public folders security admin form to be trusted. And .NET addins are never trusted. I usually use Redemption (www.dimastr.com/redemption) to avoid all the security problems and therefore I don't have to worry about Outlook version and whether it trusts addins or if Exchange is being used. -- 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 "Herve cadieu" <Hervecadieu@discussions.microsoft.com> wrote in message news:EDD45FDA-DAEF-4E2E-9389-A0152B70A4FB@microsoft.com... > Thanks Ken, > > From that when I get the right inspector item in outlook , what piece code > is needed to send the said email after checking that I ghave at least one > recipient filled ? |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

