A single button

Add-in Express™ Support Service
That's what is more important than anything else

A single button
 
Giancarlo




Posts: 67
Joined: 2016-08-17
This library is very large.
At the moment my understanding is very low.
I read the tutorial. I tried to study the examples, but I still have many shortcomings.

Now I'll explain exactly what I want to realize.
So you can tell me the best way to go.

I'd like to put a button on the Outlook HOME
(See the Green button in the image)

User added an image

I'm working on your project "Your First Microsoft Outlook COM Add-in"

I have seen that I can add the button in the ribbon, or in my Task Pane

In the ribbon it is uncomfortable, because to use it
I must first click ribbon tab

In my task is comfortable, because it is immediately accessible via a single click,
but it is visually ugly

The best place would be where I drew the green button, but I do not understand how to do.



second problem

I modified the "My Task Panel" adding this event to the button:


procedure TMyTaskPane.Button1Click(Sender: TObject);
begin
  adxcoMyOutlookAddin1.AdxOlInspectorCommandBar1Controls0Click(Sender);
end;



pressing the button, I get the error:
Access Violation

To work correctly, I must first double-click the message

User added an image

But in this way, it is again uncomfortable
Posted 19 Aug, 2016 05:32:12 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Giancarlo,

#1. You put a Ribbon Tab component onto the add-in module, add a group to the tab, and add a button to the group. Then you set the tab's IdMso property to the Id of the built-in Ribbon tab. On how to get Ids of built-in ribbon controls, see section Referring to Built-in Ribbon Controls, see the PDF file in the folder {Add-in Express}\Docs on your development PC. In your case, the Id of the built-in tab shown in your screenshots is 'TabMail' (download the archive, unpack it, and see OutlookExplorerControls.xls). Also, you must set the Ribbons property of the tab to msrOutlookExplorer (that built-in tab is only shown in this Ribbon).

#2.
Giancarlo writes:
To work correctly, I must first double-click the message


This is because the code of that method gets the active Outlook inspector and then retrieves information from the Outlook item opened in that inspector. You get the error if no inspector is shown. The AdxOlExplorerCommandBar1Controls0Click retrives information from the item selected in the active Outlook Explorer window.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Aug, 2016 06:18:11 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
following your instructions,
in Excel I found the policyd 17460
it's correct?

When I set the property
adxRibbonTab2.idMso = 17460

in outlook i don't see all Ribbon Tabs

if i cancel adxRibbonTab2.idMso property, i see all Ribbon Tabs

If you give me an email, I can send the project
Posted 19 Aug, 2016 08:31:50 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Giancarlo writes:
following your instructions, in Excel I found the policyd 17460 it's correct?


The instruction in the manual points to the "Control Name" column.

Andrei Smolin writes:
In your case, the Id of the built-in tab shown in your screenshots is 'TabMail' (download the archive, unpack it, and see OutlookExplorerControls.xls).


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Aug, 2016 08:37:20 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
Ok now i understand
Thank you
Posted 19 Aug, 2016 09:00:04 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
You are welcome.

Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 19 Aug, 2016 09:26:41 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
Which excel sheet I have to look
to insert the button on the reply form?

I tried
idMso = TabNewMailMessage
but only appears on a new email
Posted 25 Aug, 2016 04:29:15 Top
Andrei Smolin


Add-in Express team


Posts: 14106
Joined: 2006-05-11
Hello Giancarlo,

This is a correct IdMso. That tab is shown when you compose (reply or create) an email. If you need to show your button only when you reply, you can check the item (Inspector.CurrentItem) in e.g. InspectorActivate event and hide the button if required. Ken Slovak suggests here:


A reply or forward message should have ConversationIndex and ConversationTopic properties that aren't null or null string. It will also have Saved = false when it opens.


Regards from Belarus (GMT+3),

Andrei Smolin
Add-in Express Team Leader
Posted 25 Aug, 2016 05:47:09 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
I understand better the problem:
it's like you say:
if I open the message and reply
I see the button

if I click the Reply button from first image (my first image of this post)
I do not see

User added an image

How do I show the button here?
Posted 25 Aug, 2016 07:37:52 Top
Giancarlo




Posts: 67
Joined: 2016-08-17
On second thought, probably the button must be entered here
User added an image
Posted 25 Aug, 2016 08:01:53 Top