Word & outlook interaction ??s...
by TWFyayBCdXJucw » Sat, 22 Apr 2006 23:20:01 GMT
We're considering building an Office automation application, and have a
question about Outlook & Word interaction. If Word (2003) is selected as the
Outlook eMail editor and our application has code which runs in the templat's
Document_New and Document_open events...
1) is there a way to control which template is used when Outlook fires up
word to create a new eMail message?
2) will that code run when an eMail message is being composed?
3) If that code runs and creates new Properties on the Document object
(Document Metadata), will that metadata be saved/stored with the document
when it becomes an email message?
4) if so, where would that metadata be found once Outlook/exchange stores
the message?
Thanks for any insights anybody can share on these questions.
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Tue, 25 Apr 2006 22:07:05 GMT
For use with WordMail the code actually should be running in Outlook. That
is done using the NewInspector event of the Inspectors collection to get the
newly opened item from Inspector.CurrentItem. If it's an email item and
IsWordMail is True it will be a WordMail item.
From that MailItem.WordEditor you can get the Word document object.
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Re: Word & outlook interaction ??s...
by TWFyayBCdXJucw » Thu, 27 Apr 2006 22:10:02 GMT
Ken,
Thanks for the response!
Ok, this (and some other feedback I've gotten elsewhere) leads me to another
question...or two.
Is it possible to store (hidden) metadata inside Outlook eMail messages
(without resort to using file attachments or using Word as the email editor)?
if so...how?
This is all for Records Identification and implementing Corporate Records
Retention Policy purposes.
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Thu, 27 Apr 2006 22:33:02 GMT
Outlook items have a UserProperties collection that you can add a
UserProperty to (or more than 1). That can serve to contain metadata of
whatever types you want. Those would be visible to the user however if they
select those fields in the Field Chooser or print the items.
For truly hidden metadata I always use MAPI named properties. Those are in
the same namespace as Outlook UserProperties but invisible to the UI and can
only be seen using a MAPI tool such as MFCMAPI or OutlookSpy.
You can't get there from here with the Outlook object model however. I use
Redemption (www.dimastr.com/redemption) for that myself, an alternative
would be to use CDO 1.21 or Extended MAPI to add those named properties to
the items. I store all sorts of metadata on items that way.
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Re: Word & outlook interaction ??s...
by TWFyayBCdXJucw » Sun, 30 Apr 2006 00:03:02 GMT
Ken,
Thanks again! ...and did I mention how awesome you are?...
PS - Why did you choose redemtpion over the CDO or Extended MAPI alternatives?
...any there any major technical reasons (like deployment issues) I should
factor into selecting from those alternatives (or any others)?
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Mon, 01 May 2006 03:35:36 GMT
I do most of my programming in VB 6, with prototyping in VBA.
Extended MAPI in general requires C++ or Delphi, although you can do a few
things using VB (see the MAPILabs example of using HrGetOneProp to get a
PT_STRING8 value).
CDO is old and tired and will only be available in Outlook 2007 by download
from MS. It's subject to the security prompts and hasn't been really updated
for years, although it's certainly usable. It's an optional component that
is non-distributable, so you have to demand install it from the Office CD or
shared install point if it's not already installed.
Redemption can be customized for security, it now has all the power of CDO
plus a some of the power and speed of Extended MAPI and it's
redistributable. I've finished rewriting all my apps that use CDO to now use
RDO objects in Redemption and now only use Redemption myself. YMMV.
If I use a .NET language, CDO and EX MAPI aren't supported for use across
the Interop and some things won't work, or won't work all the time or work
reliably. Redemption works fine across the Interop.
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Re: Word & outlook interaction ??s...
by TWFyayBCdXJucw » Tue, 02 May 2006 22:22:02 GMT
Ken,
Dang! ...Glad I asked!
So, what's Microsoft's "future direction" here, then?
Extended MAPI? ...so we're awaiting release of some new
CDO.NET/XMAPI.NET/somethingorother from MS, or what?
...or are they just going to acquire "Redemption"?
<I like the notion of that salvationary double-entendre, at least> ;-)
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Wed, 03 May 2006 02:06:27 GMT
Microsoft's future direction is clear, use .NET languages. That this is a
less than compelling story for Office applications is another story.
There are no plans that I'm aware of to support Extended MAPI or CDO in .NET
managed code and no plans that I'm aware of to make new builds of those
API's for .NET compatibility.
This doesn't help at all if you have to support older versions of Office,
but Outlook 2007 has a unified object model with access to Stores and Fields
(PropertyAccessor) and just about anything else you can do with CDO or even
Redemption. I can actually do real advanced Outlook programming in Outlook
2007 only using the Outlook object model. VSTO V3 is also a very nice
solution for .NET programming for Outlook 2007.
Of course in the real world my clients want support going back to Outlook
2000, so VSTO and the wonderful work done on the OOM by the Outlook team
doesn't help for that. Microsoft's answer of course will be for everyone to
upgrade to Office 2007.
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Re: Word & outlook interaction ??s...
by TWFyayBCdXJucw » Wed, 03 May 2006 03:48:02 GMT
Ken,
Hmmm...I've read in the publicly available "Office 12" documents that they
plan to release some upgrades to the Office 2k/03 versions so that those
Office versions will read and wrte the newer "Office 12" XML document file
formats after "Office 12" ships... Is there any chance, then that the VSTO v3
_will_ be able to interface with the Outlook 2k/03 versions after the "Office
12-compatibility update"? (not that I'll be holding my breath, understand)
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Wed, 03 May 2006 05:38:29 GMT
You can use VSTO for Outlook 2003 and 2007. I don't expect anything for it
for earlier versions, which are now out of mainstream support anyway.
I haven't heard about any plans to update earlier versions of Outlook at
all. I'd be inclined to doubt it, but can you cite where you read that?
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Re: Word & outlook interaction ??s...
by TWFyayBCdXJucw » Wed, 03 May 2006 21:27:02 GMT
Ken,
Look here: http://www.**--****.com/
Pay particular attention to the last bullet point at the bottom: compatibility
...which now that I read it again, probably only refers to Word, Excel, and
Powerpoint documents, but...?<shrug>?
Re: Word & outlook interaction ??s...
by Ken Slovak - [MVP - Outlook] » Wed, 03 May 2006 22:18:24 GMT
That's just for being able to use the new zipped file formats that Word,
Excel and so on are going to use as defaults in Office 2007. It has nothing
to do with Outlook, which won't be using those zipped formats so it's
irrelevant to Outlook users.
MS plans to offer updates for older versions of Word, etc. so users can work
with the new file formats. If they didn't the file formats would have little
chance of being adopted by many organizations that need to maintain backward
compatibility.
--
Ken Slovak
[MVP - Outlook]
http://www.**--****.com/
Author: Absolute Beginner's Guide to Microsoft Office Outlook 2003
Reminder Manager, Extended Reminders, Attachment Options
http://www.**--****.com/
Similar Threads:
1.Strange Word/Outlook Interaction
I've written an application which opens Word and then loads an addin (which
I also wrote). I've just noticed that, if you start Outlook after my
application has started, and if you've set Word as your email editor in
Outlook, then Outlook seems to inherit the addin. (I can tell this because
of the toolbar buttons which appear in new email messages). Then, when I
shut down my app, the addin stays loaded in Outlook--which I don't want. So
I tried unloading the addin before exiting my app, which gets rid of the
addin but leads to other strangeness: despite the fact that I've called
application.quit from my code, an empty Word window appears. If I hit
Alt-F11, I find that this window has an "email" template project loaded.
Then, when I close the empty Word window, and close Outlook, I still see
Winword running in the task manager.
So I have several questions:
1. Is there anyway to prevent Outlook from attaching to already running
version of Word?
2. Where is this empty Word window coming from after I exit from my app, and
how can I get rid of it?
3. When I close the empty Word window and close Outlook, why is there still
a Winword running?
Thanks...
Dan
2.E-mail Envelope (Word/Outlook Interaction)
Getting a message about the "e-mail envelope not available" when trying to
send via Outlook from MS Word. This is Office XP (latest updates/SP) and
Outlook 2003 (completely up to date). MS KB article doesn't apply.
3.Outlook Express negative interaction w Word & Outlook Office 2000
OE is acting very strange. Three things are occurring:
1. When I close OE, I always get the message, "Outlook Express has
encountered a problem and needs to close". I get this even though I have
already closed OE.
2. Word has sporadically been freezing on me, and I noticed that whenever
this occurs, if I close Outlook Express, Word starts to work immediately.
3. When I turn on my computer, I get the following messages in sequence, as
I cancel one after the other:
A. Plse wait while Windows configures Microsoft Office 2000 Professional.
B. The feature you are trying to use is on a CD-ROM that is not available.
Insert....etc.
C. The path Microsoft Office 2000 Professional cannot be found....etc.
D. An error has occurred in script on this page. Line 79....etc.
Can anyone help solve this?
Thank you!
--
richn13