New Inspector word editor crash Outlook 2003

Status
Not open for further replies.
T

Tom

Hi all,

I have a rather interesting issue with Outlook 2003. When a create a new

email message using automation outlook will crash if I try to request the

word editor(GetWordEditor) during the new inspector event.

***************************************

My settings

***************************************

1. I have Word selected as my default HTML editor. So every new message

uses word.

2. Every thing works perfect when I create a new message using Outlook menu

or new message button. (No Issues at all)

Here is the scenario the breaks.

***************************************

From button command in main window

***************************************

CComPtr<IDispatch> spDisp;

HRESULT hr = m_spApplication->raw_CreateItem(Outlook::eek:lMailItem, &spDisp);

if(SUCCEEDED(hr) && spDisp)

{

CComPtr<Outlook::_MailItem> spMailItem;

hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),

(LPVOID*)&spMailItem);

if(SUCCEEDED(hr) && spMailItem)

{

spMailItem->PutBodyFormat(Outlook::eek:lFormatHTML);

// This will generate the "new" inspector event.

spMailItem->Display(_variant_t(true));

}

}

***************************************

In the new inspector

***************************************

if(m_spInspector->GetEditorType() == Outlook::eek:lEditorWord)

m_bEditorIsWord = TRUE;

if(m_bEditorIsWord)

{

KABOOOOOM !!!!
> >>>>>>CComPtr<IDispatch> spD = m_spInspector->GetWordEditor();


<<<<<<<<<<<<

KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!

}

IF I comment out the faulty lines of code -- surprisingly --- the new

message will invoke the HTML editor and NOT the word editor. STRANGE!! This

happens on every machine I have tested this on.

Has anybody run into this issue?

Thanks,

Tom -
 
T

Tom

More info ....

I switched the email editor to HTML only and it still fails. It appears to

me that the inspector is returning a bad value for GetEditorType()

"Tom" <tom@gigasoftdevelopment.com> wrote in message

news:eIflCvD$KHA.1892@TK2MSFTNGP05.phx.gbl...
> Hi all,

> I have a rather interesting issue with Outlook 2003. When a create a new
> email message using automation outlook will crash if I try to request the
> word editor(GetWordEditor) during the new inspector event.

> ***************************************
> My settings
> ***************************************
> 1. I have Word selected as my default HTML editor. So every new message
> uses word.
> 2. Every thing works perfect when I create a new message using Outlook
> menu or new message button. (No Issues at all)

> Here is the scenario the breaks.

> ***************************************
> From button command in main window
> ***************************************
> CComPtr<IDispatch> spDisp;
> HRESULT hr = m_spApplication->raw_CreateItem(Outlook::eek:lMailItem,
> &spDisp);

> if(SUCCEEDED(hr) && spDisp)
> {
> CComPtr<Outlook::_MailItem> spMailItem;
> hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
> (LPVOID*)&spMailItem);
> if(SUCCEEDED(hr) && spMailItem)
> {
> spMailItem->PutBodyFormat(Outlook::eek:lFormatHTML);

> // This will generate the "new" inspector event.
> spMailItem->Display(_variant_t(true));
> }
> }

> ***************************************
> In the new inspector
> ***************************************
> if(m_spInspector->GetEditorType() == Outlook::eek:lEditorWord)
> m_bEditorIsWord = TRUE;

> if(m_bEditorIsWord)
> {
> KABOOOOOM !!!!
> >>>>>>>CComPtr<IDispatch> spD = m_spInspector->GetWordEditor();

> <<<<<<<<<<<<

> KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!
> }

> IF I comment out the faulty lines of code -- surprisingly --- the new
> message will invoke the HTML editor and NOT the word editor. STRANGE!!
> This happens on every machine I have tested this on.

> Has anybody run into this issue?

> Thanks,
> Tom -
>
 
T

Tom

Never mind - I found an error in my code

"Tom" <tom@gigasoftdevelopment.com> wrote in message

news:ekuNS2D$KHA.5808@TK2MSFTNGP02.phx.gbl...
> More info ....

> I switched the email editor to HTML only and it still fails. It appears to
> me that the inspector is returning a bad value for GetEditorType()

> "Tom" <tom@gigasoftdevelopment.com> wrote in message
> news:eIflCvD$KHA.1892@TK2MSFTNGP05.phx.gbl...
> > Hi all,
>

>> I have a rather interesting issue with Outlook 2003. When a create a new
> > email message using automation outlook will crash if I try to request the
> > word editor(GetWordEditor) during the new inspector event.
>

>> ***************************************
> > My settings
> > ***************************************
> > 1. I have Word selected as my default HTML editor. So every new message
> > uses word.
> > 2. Every thing works perfect when I create a new message using Outlook
> > menu or new message button. (No Issues at all)
>

>> Here is the scenario the breaks.
>

>> ***************************************
> > From button command in main window
> > ***************************************
> > CComPtr<IDispatch> spDisp;
> > HRESULT hr = m_spApplication->raw_CreateItem(Outlook::eek:lMailItem,
> > &spDisp);
>

>> if(SUCCEEDED(hr) && spDisp)
> > {
> > CComPtr<Outlook::_MailItem> spMailItem;
> > hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
> > (LPVOID*)&spMailItem);
> > if(SUCCEEDED(hr) && spMailItem)
> > {
> > spMailItem->PutBodyFormat(Outlook::eek:lFormatHTML);
>

>> // This will generate the "new" inspector event.
> > spMailItem->Display(_variant_t(true));
> > }
> > }
>

>> ***************************************
> > In the new inspector
> > ***************************************
> > if(m_spInspector->GetEditorType() == Outlook::eek:lEditorWord)
> > m_bEditorIsWord = TRUE;
>

>> if(m_bEditorIsWord)
> > {
> > KABOOOOOM !!!!
> > >>>>>>>CComPtr<IDispatch> spD = m_spInspector->GetWordEditor();

> > <<<<<<<<<<<<
>

>> KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!
> > }
>

>
>> IF I comment out the faulty lines of code -- surprisingly --- the new
> > message will invoke the HTML editor and NOT the word editor. STRANGE!!
> > This happens on every machine I have tested this on.
>

>> Has anybody run into this issue?
>

>> Thanks,
> > Tom -
> >


>
 
K

Ken Slovak - [MVP - Outlook]

FWIW, when NewInspector() fires you get what are called weak object

references for the Inspector and for the Inspector.CurrentItem. This is a

worst case with WordMail and with Outlook 2007 or later. My rule of thumb is

to only check for Inspector.CurrentItem.Class or CurrentItem.MessageClass in

that event and to defer anything else to the first Inspector.Activate()

event handler on the Inspector. By that time the object references are

strong and fully fleshed out.

"Tom" <tom@gigasoftdevelopment.com> wrote in message

news:Ol1M24D$KHA.3176@TK2MSFTNGP05.phx.gbl...
> Never mind - I found an error in my code

> "Tom" <tom@gigasoftdevelopment.com> wrote in message
> news:ekuNS2D$KHA.5808@TK2MSFTNGP02.phx.gbl...
> > More info ....
>

>> I switched the email editor to HTML only and it still fails. It appears
> > to me that the inspector is returning a bad value for GetEditorType()
>

>
>
>> "Tom" <tom@gigasoftdevelopment.com> wrote in message
> > news:eIflCvD$KHA.1892@TK2MSFTNGP05.phx.gbl...
> >> Hi all,
> >
>>> I have a rather interesting issue with Outlook 2003. When a create a new
> >> email message using automation outlook will crash if I try to request
> >> the word editor(GetWordEditor) during the new inspector event.
> >
>>> ***************************************
> >> My settings
> >> ***************************************
> >> 1. I have Word selected as my default HTML editor. So every new message
> >> uses word.
> >> 2. Every thing works perfect when I create a new message using Outlook
> >> menu or new message button. (No Issues at all)
> >
>>> Here is the scenario the breaks.
> >
>>> ***************************************
> >> From button command in main window
> >> ***************************************
> >> CComPtr<IDispatch> spDisp;
> >> HRESULT hr = m_spApplication->raw_CreateItem(Outlook::eek:lMailItem,
> >> &spDisp);
> >
>>> if(SUCCEEDED(hr) && spDisp)
> >> {
> >> CComPtr<Outlook::_MailItem> spMailItem;
> >> hr = spDisp->QueryInterface(__uuidof(Outlook::_MailItem),
> >> (LPVOID*)&spMailItem);
> >> if(SUCCEEDED(hr) && spMailItem)
> >> {
> >> spMailItem->PutBodyFormat(Outlook::eek:lFormatHTML);
> >
>>> // This will generate the "new" inspector event.
> >> spMailItem->Display(_variant_t(true));
> >> }
> >> }
> >
>>> ***************************************
> >> In the new inspector
> >> ***************************************
> >> if(m_spInspector->GetEditorType() == Outlook::eek:lEditorWord)
> >> m_bEditorIsWord = TRUE;
> >
>>> if(m_bEditorIsWord)
> >> {
> >> KABOOOOOM !!!!
> >> >>>>>>>CComPtr<IDispatch> spD = m_spInspector->GetWordEditor();
> >> <<<<<<<<<<<<
> >
>>> KABOOOOOM !!!! The dispatch pointer is NULL!!! Uhg!!!!
> >> }
> >
>>
>>> IF I comment out the faulty lines of code -- surprisingly --- the new
> >> message will invoke the HTML editor and NOT the word editor. STRANGE!!
> >> This happens on every machine I have tested this on.
> >
>>> Has anybody run into this issue?
> >
>>> Thanks,
> >> Tom -
> >>

>

>>


>
 
Status
Not open for further replies.
Similar threads
Thread starter Title Forum Replies Date
M Outlook 2010 How could I globally redesign an outlook template form/region/inspector template used to display mail lists or an individual mails? Outlook VBA and Custom Forms 0
B Auto Preview Attachment in Inspector Reading Pane Outlook VBA and Custom Forms 1
D help with Item/Inspector close event Outlook VBA and Custom Forms 1
A running code after the new inspector is visible Outlook VBA and Custom Forms 1
N Modal form is not properly working on inspector Outlook VBA and Custom Forms 10
K add a designed group into a existing inspector ribbon Outlook VBA and Custom Forms 7
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
E Accessing a Form Region from an Inspector Outlook VBA and Custom Forms 3
T How to get Inspector object from Window handle Outlook VBA and Custom Forms 2
K Get Inspector Ptr In Outlook 2007. Outlook VBA and Custom Forms 3
T How to get Inspector or MailItem from wordEditor Outlook VBA and Custom Forms 6
S PR_MESSAGEFLAGS & Compose/Read - Inspector Outlook VBA and Custom Forms 4
S Error 287 on Inspector.Close() Outlook VBA and Custom Forms 4
K Buttons are added multiple times in New Inspector window Outlook VBA and Custom Forms 4
V How to find mailitem in the inspector is a brand new one Outlook VBA and Custom Forms 2
A active inspector in memory Outlook VBA and Custom Forms 1
B How to get the path from an outlook.Inspector Outlook VBA and Custom Forms 4
M How to get active inspector window handle? Outlook VBA and Custom Forms 3
A disable a menu in active inspector Outlook VBA and Custom Forms 1
S inspector toolbar buttons get multiple events Outlook VBA and Custom Forms 3
S Quick access toolbar in inspector window Outlook VBA and Custom Forms 3
T Using Ribbon in Inspector window Outlook VBA and Custom Forms 2
P Inspector.WordEditor always returns null Outlook VBA and Custom Forms 3
Q Inspector Bug/Question Outlook VBA and Custom Forms 3
Z Inspector.CurrentItem causes Shared Calendar Issue Outlook VBA and Custom Forms 5
V Embedding hyperlink into Word document Using Outlook 2
glnz Can Word Normal.dotm interfere with Outlook? Office 2016 Using Outlook 5
S Outlook Macro to move reply mail based on the key word in the subjectline Outlook VBA and Custom Forms 0
C blocking two or more word domains separated by period/dot Using Outlook 3
P Outlook 2013 Word Share doc as Email Attachment now brings up Eudora. Using Outlook 1
Jennifer Murphy Ctrl+Tab sometimes will not move through text a word at a time Using Outlook 1
N How to remove signature formatting from Text in Word (accidentally taken from Outlook) Using Outlook 0
C replace subject line generated by converting a word document to PDF and sending it to an email Using Outlook 8
Diane Poremsky Use Word Macro to Apply Formatting to Email Using Outlook 0
iwshim word shortcut to search outlook Using Outlook 3
C Outlook 2016 - converting Word VBA to default Outlook message Outlook VBA and Custom Forms 0
C Merging Word and Access into Outlook Using Outlook 4
Q Why can't I copy image with embedded hyperlink from email to Word Using Outlook 0
Mark Foley Emailing attachment from Word/Excel sends attachment but no message body Using Outlook 0
Diane Poremsky Disable Live Preview in Outlook and Word Using Outlook 0
Philip Rose Recreating a WORD Editing Macro to use in Outlook VBA Outlook VBA and Custom Forms 4
D Need to extract a line from a word attachment, and add it to the subject line Outlook VBA and Custom Forms 3
M Unable to email from Word or Excel Using Outlook 11
P Macros in Word 2003 - how to transfer to another Word 2003? Using Outlook 1
J VBS Script (macro) for word to open Outlook template. Outlook VBA and Custom Forms 2
B Outlook to Word Template error Using Outlook 4
J Outlook body to word document Outlook VBA and Custom Forms 11
A Is it possible to remove the word Categories: from task list views? Using Outlook 2
A Application_ItemSend not accessed when sending email outside outlook (i.e. word or send to mail from Using Outlook 7
W Macro to add a word in Subject Line Using Outlook 1

Similar threads

Top