adding_new_tab.txt | |
---|---|
1 | <tab id="MyTab" label="AmdocsTool" getVisible="MyTab_GetVisible"> |
2 | <group id="ContentGroup" label="Content"> |
3 | <button id="textButton" label="Apply for leave" |
4 | screentip="Text" onAction="OnTextButton" |
5 | supertip="Inserts text at the cursor location."/> |
6 | <button id="tableButton" label="Cancel Leave" |
7 | screentip="Table" onAction="OnTableButton" |
8 | supertip="Inserts a table at the cursor location."/> |
9 | </group> |
10 | </tab> |
11 | |
12 | <tab idMso="TabMail"> |
13 | <group id="ContentGroup1" label="Content"> |
14 | <button id="textButton1" label="Apply for leave" |
15 | screentip="Text" onAction="OnTextButton1" |
16 | supertip="Inserts text at the cursor location."/> |
17 | <button id="tableButton1" label="Cancel Leave" |
18 | screentip="Table" onAction="OnTableButton1" |
19 | supertip="Inserts a table at the cursor location."/> |
20 | </group> |
21 | |
22 | </tab> |
23 | |
24 | |
25 | |
26 | |
27 | public bool MyTab_GetVisible(Office.IRibbonControl control) |
28 | { |
29 | if (control.Context is Outlook.Explorer) |
30 | { |
31 | Outlook.Explorer explorer = |
32 | control.Context as Outlook.Explorer; |
33 | Outlook.Selection selection = explorer.Selection; |
34 | if (selection.Count == 1) |
35 | { |
36 | if (selection[1] is Outlook.MailItem) |
37 | { |
38 | Outlook.MailItem oMail = |
39 | selection[1] as Outlook.MailItem; |
40 | if (oMail.Sent == true) |
41 | { |
42 | return true; |
43 | } |
44 | else |
45 | { |
46 | return false; |
47 | } |
48 | } |
49 | else |
50 | { |
51 | return false; |
52 | } |
53 | } |
54 | else |
55 | { |
56 | return false; |
57 | } |
58 | } |
59 | else if (control.Context is Outlook.Inspector) |
60 | { |
61 | Outlook.Inspector oInsp = |
62 | control.Context as Outlook.Inspector; |
63 | if (oInsp.CurrentItem is Outlook.MailItem) |
64 | { |
65 | Outlook.MailItem oMail = |
66 | oInsp.CurrentItem as Outlook.MailItem; |
67 | if (oMail.Sent == true) |
68 | { |
69 | return true; |
70 | } |
71 | else |
72 | { |
73 | return false; |
74 | } |
75 | } |
76 | else |
77 | { |
78 | return false; |
79 | } |
80 | } |
81 | else |
82 | { |
83 | return true; |
84 | } |
85 | } |