Skip to content

Commit 0619aea

Browse files
author
jdeigendesch
committed
Changed to "Hello World"
1 parent 5ba8f6a commit 0619aea

File tree

8 files changed

+75
-77
lines changed

8 files changed

+75
-77
lines changed

OutlookAddIn-Example/OutlookAddIn-Example/OutlookAddIn-Example.csproj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -201,7 +201,7 @@
201201
<EmbeddedResource Include="Resources\Ribbon.xml" />
202202
</ItemGroup>
203203
<ItemGroup>
204-
<Content Include="Resources\Smile.png" />
204+
<Content Include="Resources\World.png" />
205205
</ItemGroup>
206206
<PropertyGroup>
207207
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>

OutlookAddIn-Example/OutlookAddIn-Example/Resource.Designer.cs

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

OutlookAddIn-Example/OutlookAddIn-Example/Resource.resx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,7 @@
121121
<data name="Ribbon" type="System.Resources.ResXFileRef, System.Windows.Forms">
122122
<value>Resources\Ribbon.xml;System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089;utf-8</value>
123123
</data>
124-
<data name="Smile" type="System.Resources.ResXFileRef, System.Windows.Forms">
125-
<value>Resources\Smile.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
124+
<data name="World" type="System.Resources.ResXFileRef, System.Windows.Forms">
125+
<value>Resources\World.png;System.Drawing.Bitmap, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a</value>
126126
</data>
127127
</root>

OutlookAddIn-Example/OutlookAddIn-Example/Resources/Ribbon.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@
66
<tabs>
77
<!--Email-Tab (Create new mail to see this button)-->
88
<tab idMso="TabNewMailMessage">
9-
<group id="GroupSmileMail" getLabel="Group_GetLabel">
10-
<button id="SmileButton"
9+
<group id="GroupHelloMail" getLabel="Group_GetLabel">
10+
<button id="HelloButton"
1111
size="large"
1212
getImage="Button_GetImage"
1313
onAction="Button_Click"
-334 Bytes
Binary file not shown.
849 Bytes
Loading
Lines changed: 45 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -1,78 +1,74 @@
1-
using System.Drawing;
2-
using System.Runtime.InteropServices;
3-
using System.Windows.Forms;
4-
using Office = Microsoft.Office.Core;
1+
namespace OutlookAddIn_Example
2+
{
3+
using System.Drawing;
4+
using System.Runtime.InteropServices;
5+
using System.Windows.Forms;
56

6-
namespace OutlookAddIn_Example {
7-
[ComVisible(true)]
8-
public class Ribbon : Office.IRibbonExtensibility {
9-
private const string GroupSmile = "Smileys";
10-
private const string Smile = "Smile";
11-
private const string TooltipSmile = "This is a tooltip to smile.";
12-
private const string HelperSmile = "Don't forget to smile!";
13-
private const string GroupInfo = "Info";
14-
private const string Info = "Some information about this Outlook Add-In ...";
15-
private const string GithubExample = "GitHub-Example";
16-
17-
private Office.IRibbonUI _ribbon;
7+
using Office = Microsoft.Office.Core;
188

19-
#region IRibbonExtensibility Members
9+
[ComVisible(true)]
10+
public class Ribbon : Office.IRibbonExtensibility
11+
{
12+
private Office.IRibbonUI ribbon;
2013

21-
public string GetCustomUI(string ribbonId) {
14+
public string GetCustomUI(string ribbonId)
15+
{
2216
return Resource.Ribbon;
2317
}
2418

25-
#endregion
26-
27-
#region Ribbon Callbacks
28-
29-
//Create callback methods here. For more information about adding callback methods, visit http://go.microsoft.com/fwlink/?LinkID=271226
30-
31-
public void Ribbon_Load(Office.IRibbonUI ribbonUi) {
32-
_ribbon = ribbonUi;
19+
public void Ribbon_Load(Office.IRibbonUI ribbonUi)
20+
{
21+
this.ribbon = ribbonUi;
3322
}
3423

35-
public string Group_GetLabel(Office.IRibbonControl control) {
36-
return GroupSmile;
24+
public string Group_GetLabel(Office.IRibbonControl control)
25+
{
26+
return "Hello";
3727
}
3828

39-
public Bitmap Button_GetImage(Office.IRibbonControl control) {
40-
return Resource.Smile;
29+
public Bitmap Button_GetImage(Office.IRibbonControl control)
30+
{
31+
return Resource.World;
4132
}
4233

43-
public void Button_Click(Office.IRibbonControl control) {
44-
MessageBox.Show(Smile);
34+
public void Button_Click(Office.IRibbonControl control)
35+
{
36+
MessageBox.Show("Hello World...");
4537
}
4638

47-
public string Button_GetTip(Office.IRibbonControl control) {
48-
return TooltipSmile;
39+
public string Button_GetTip(Office.IRibbonControl control)
40+
{
41+
return "Hello Tooltip";
4942
}
5043

51-
public string Button_GetLabel(Office.IRibbonControl control) {
52-
return Smile;
44+
public string Button_GetLabel(Office.IRibbonControl control)
45+
{
46+
return "Say hello";
5347
}
5448

55-
public string Group_GetHelperText(Office.IRibbonControl control) {
56-
return HelperSmile;
49+
public string Group_GetHelperText(Office.IRibbonControl control)
50+
{
51+
return "Be friendly and say hello!";
5752
}
5853

59-
public string GroupInfo_GetLabel(Office.IRibbonControl control) {
60-
return GroupInfo;
54+
public string GroupInfo_GetLabel(Office.IRibbonControl control)
55+
{
56+
return "Info about Hello World";
6157
}
6258

63-
public string Info_GetLabel(Office.IRibbonControl control) {
64-
return Info;
59+
public string Info_GetLabel(Office.IRibbonControl control)
60+
{
61+
return "Some information about saying hello to the world..";
6562
}
6663

67-
68-
public string TabSmileys_GetLabel(Office.IRibbonControl control) {
69-
return GroupSmile;
64+
public string TabSmileys_GetLabel(Office.IRibbonControl control)
65+
{
66+
return "Hello";
7067
}
7168

72-
public string LinkDownload_GetLabel(Office.IRibbonControl control) {
73-
return GithubExample;
69+
public string LinkDownload_GetLabel(Office.IRibbonControl control)
70+
{
71+
return "GitHub-Example";
7472
}
75-
76-
#endregion
7773
}
7874
}
Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,34 @@
1-
using System;
2-
using Office = Microsoft.Office.Core;
1+
namespace OutlookAddIn_Example
2+
{
3+
using System;
34

4-
namespace OutlookAddIn_Example {
5-
public partial class ThisAddIn {
6-
private void ThisAddIn_Startup(object sender, EventArgs e) {
7-
}
5+
using Office = Microsoft.Office.Core;
86

9-
private void ThisAddIn_Shutdown(object sender, EventArgs e) {
10-
// Note: Outlook no longer raises this event. If you have code that
11-
// must run when Outlook shuts down, see http://go.microsoft.com/fwlink/?LinkId=506785
7+
public partial class ThisAddIn
8+
{
9+
protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject()
10+
{
11+
return new Ribbon();
1212
}
1313

14-
protected override Office.IRibbonExtensibility CreateRibbonExtensibilityObject() {
15-
return new Ribbon();
14+
private void ThisAddIn_Startup(object sender, EventArgs e)
15+
{
1616
}
1717

18-
#region VSTO generated code
18+
private void ThisAddIn_Shutdown(object sender, EventArgs e)
19+
{
20+
// Note: Outlook no longer raises this event. If you have code that
21+
// must run when Outlook shuts down, see http://go.microsoft.com/fwlink/?LinkId=506785
22+
}
1923

2024
/// <summary>
2125
/// Required method for Designer support - do not modify
2226
/// the contents of this method with the code editor.
2327
/// </summary>
24-
private void InternalStartup() {
25-
Startup += ThisAddIn_Startup;
26-
Shutdown += ThisAddIn_Shutdown;
28+
private void InternalStartup()
29+
{
30+
this.Startup += this.ThisAddIn_Startup;
31+
this.Shutdown += this.ThisAddIn_Shutdown;
2732
}
28-
29-
#endregion
3033
}
3134
}

0 commit comments

Comments
 (0)