![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
I'm writing an Outlook Add-In, using C# in VS 2005. ( not using VSTO) .
The Add-In uses the shim provided my Microsoft for developing add-ins. Here's a snippet of the code... Outlook.Inspector oi = MailItem.GetInspector; Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)oi.WordEdi tor; I need to position the cursor at a certain location in a part of message body I populate when the mail item is created, hence why I need access to the WordEditor Any help greatly appreciated... Thanks -- Peter O'Dowd Exchange Server MVP http://www.blade.net.nz |
Ads |
#2
|
|||
|
|||
![]()
Hi Peter,
Outlook version you want to work with? In Outlook 2007 I've found that until the first Inspector.Activate() event fires that IsWordMail() and WordEditor are null. That's especially the case if you try to get those during NewInspector(). -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Peter O'Dowd (MVP)" wrote in message ... I'm writing an Outlook Add-In, using C# in VS 2005. ( not using VSTO) . The Add-In uses the shim provided my Microsoft for developing add-ins. Here's a snippet of the code... Outlook.Inspector oi = MailItem.GetInspector; Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)oi.WordEdi tor; I need to position the cursor at a certain location in a part of message body I populate when the mail item is created, hence why I need access to the WordEditor Any help greatly appreciated... Thanks -- Peter O'Dowd Exchange Server MVP http://www.blade.net.nz |
#3
|
|||
|
|||
![]()
Hi Ken,
Yes it is Outlook 2007. Thanks for the info, I'll investigate ![]() Cheers -- Peter O'Dowd Exchange Server MVP http://www.blade.net.nz "Ken Slovak - [MVP - Outlook]" wrote in message ... Hi Peter, Outlook version you want to work with? In Outlook 2007 I've found that until the first Inspector.Activate() event fires that IsWordMail() and WordEditor are null. That's especially the case if you try to get those during NewInspector(). -- Ken Slovak [MVP - Outlook] http://www.slovaktech.com Author: Professional Programming Outlook 2007. Reminder Manager, Extended Reminders, Attachment Options. http://www.slovaktech.com/products.htm "Peter O'Dowd (MVP)" wrote in message ... I'm writing an Outlook Add-In, using C# in VS 2005. ( not using VSTO) . The Add-In uses the shim provided my Microsoft for developing add-ins. Here's a snippet of the code... Outlook.Inspector oi = MailItem.GetInspector; Microsoft.Office.Interop.Word.Document doc = (Microsoft.Office.Interop.Word.Document)oi.WordEdi tor; I need to position the cursor at a certain location in a part of message body I populate when the mail item is created, hence why I need access to the WordEditor Any help greatly appreciated... Thanks -- Peter O'Dowd Exchange Server MVP http://www.blade.net.nz |
#4
|
|||
|
|||
![]()
I am having the same problem after the upgrade to 2007 wiht outomation that I
had in place with NewInspector() event... My work-around was the following: 1) Use NewInspector event to set local class variable to the inspector 2) Define the Activate event for the new inspector variable. Here is my simplified code with the asnwer: ----- Dim myOlApp As New Outlook.Application Public WithEvents myOlInspectors As Outlook.Inspectors Public WithEvents oActiveInsp As Outlook.Inspector Public Sub Initialize_handler() Set myOlApp = Application Set myOlInspectors = myOlApp.Inspectors End Sub Private Sub oActiveInsp_Activate() ' your processing code goes here... wordEditor will be defined now. ' I suggest unsetting oActiveInsp once you're done with it, so that it does not impact performance everytime you focus on this inspector. set oActiveInsp = nothing End Sub Private Sub myOlInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) Set oActiveInsp = Inspector End Sub ------ "Peter O'Dowd (MVP)" wrote: Hi Ken, Yes it is Outlook 2007. Thanks for the info, I'll investigate ![]() Cheers -- |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
WordEditor property for Inspector null in Outlook | Philip Enny | Add-ins for Outlook | 14 | September 24th 08 05:14 PM |
Inspector wrapper and Inspector close not fireing | [email protected] | Add-ins for Outlook | 1 | June 20th 08 02:53 PM |
Winform over Wordeditor | Steffen Grellmann | Add-ins for Outlook | 2 | July 10th 07 09:13 PM |
Strange WordEditor Problem | rdrtkd | Outlook and VBA | 0 | June 15th 06 03:41 AM |
Help! Inspector.Close is fired before Inspector.Activate handler finishes | Sergey Anchipolevsky | Add-ins for Outlook | 8 | February 9th 06 10:51 AM |