Problems with toolbar in outlook when using word as editor

M

Marcin Junger

Hello everyone,
I have problems creating toolbar in mail inspector. Everything works
fine when I don't use Word as mail editor; the toolbar is visible in all
inspectors, buttons are connected... When I use Word, everything is fine
with the first inspector, but when I open the second one (keeping the
1st open) I don't have my toolbar. I can click View->Toolbars and select
my toolbar, but it appeared that the buttons are not connected. More, I
have noticed that my toolbar is available in Word itself. Morover, if I
have Word open and then click in Outlook on a "New" button to create new
mail, my toolbar behaves exactly as if I had two mail inspectors open.
I create the toolbar in NewInspector event, I delete it in OnClose
event. The code that creates toolbar in OnNewInspector:
var
cbCRM : CommandBar;
idWordEditor : Word97._Document;
(...)
if Inspector.IsWordMail then begin
idWordEditor := IDispatch(Inspector.WordEditor) as _Document;
try
idWordEditor.Application.CustomizationContext := idWordEditor;
cbCRM :=
idWordEditor.CommandBars.Add('CRM',EmptyParam,EmptyParam,EmptyParam) as
CommandBar;
finally
idWordEditor := nil;
end;
end else begin
cbCRM :=
Inspector.CommandBars.Add('CRM',EmptyParam,EmptyParam,EmptyParam) as
CommandBar;
end;
cbCRM.Set_Position(msoBarTop);

Anyone has some experience in that field?
Marcin Junger, Sage Ireland
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top