Developing an outlook helper–part 5 from 5–conclusions

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javascript for Office 365

Developing Outlook helper – conclusions

As you see, the developing and testing the Outlook  simple application was made significantly and increasingly difficult . The start point also is more difficult.

Think now about a real application and his verticals also(  saving data / settings, logging, security / authorization , errors …)

What is relatively simple is the upgrade process that is simpler now (  did not mention, but involves just a re-deploy to Microsoft Store)

Another important thing : All the methods to create the application are available. This is beautiful and scaring ….

Developing an outlook helper–part 4 from 5–javascript / Office 365 project

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javascript for Office 365

Developing Outlook helper – conclusions

Develop like it was 201x:

Read about Office Javascript API and try to understand the documentation – https://dev.office.com/docs/add-ins/develop/understanding-the-javascript-api-for-office . Then realize there are some samples where you can start: https://dev.outlook.com/Samples/Addins .

You find Hello World addin (https://github.com/jasonjoh/hello-world-addin) and decide to try it. Download to the PC . The files are

C:\Users\aignat\Downloads\hello-world-addin-master\hello-world-addin-master
.gitattributes
.gitignore
app
HelloWorld.xml
LICENSE.TXT
README.md
app\compose
app\content
app\images
app\read
app\scripts
app\compose\App.css
app\compose\App.js
app\compose\Home
app\compose\Home\Home.css
app\compose\Home\Home.html
app\compose\Home\Home.js
app\content\Office.css
app\images\Close.png
app\read\App.css
app\read\App.js
app\read\Home
app\read\Home\Home.css
app\read\Home\Home.html
app\read\Home\Home.js
app\scripts\jquery-1.9.1.js

You find eventually the code that reads the email data ( in the Home.js ) and displays data(in the Home.html)

You see that this line finds the email

var item = Office.cast.item.toItemRead(Office.context.mailbox.item);

You want to modify the  code. You do not have intellisense helpers, but just documentation.

Test like it was 201x:

SO you have now a bunch of files. How to test it? You cannot test with Outlook. You do not want to deploy to Microsoft store yet. It is testing, right?

You read again what it should be done from       Hello World addin (https://github.com/jasonjoh/hello-world-addin) – and now I am quoting

"

  1. Copy the app directory from the project to your web server.
  2. Open manifest.xml in a text editor and update all instances of https://<your web server> to the base URL of the directory on your web server where you deployed the app directory.
  3. Logon to Outlook Web Access. Click on the gear cog in the upper right corner of the page and click on Manage apps.
  4. On the Manage apps page, click on the ‘+’ icon, select Add from file. Browse to the manifest.xml file included in the project.
  5. Return to the Mail view in Outlook Web Access.
  6. To try the read mode functionality of the add-in, open any message and launch the HelloWorld app from the app bar.

“ – end quoting

So you need

  1. a https server  with FTP account to deploy files
  2. an Outlook 365 account

Once you have those, it is a simple process:

  1. Copy files to the https server.
  2. Goto Outlook 365 settings, load addon from HelloWorld.xml .
  3. Verify if all ok
  4. If not, unload the addon from Office 365.
  5. Modify the files to make the app .
  6. GOTO 1

Deploy like it was 201x:

Pass to the Microsoft Store to get a developer ID and deploy to their server the application.

Developing an outlook helper–part 3 from 5–C# project

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javascript for Office 365

Developing Outlook helper – conclusions

Develop like it was  200x:

Start  Visual Studio. See that you do not have the project. Download the Office addon for VS that create the project. Find the Outlook project – that is a wizard and let you have some choices . Give a name and wait for Visual Studio to load all files.

Those are the files generated by VS2013 ( differs from version to version)

app.config
Properties
Resources
ThisAddIn.cs
ThisAddIn.Designer.cs
ThisAddIn.Designer.xml
FindInEmail.cs
FindInEmail.Designer.cs
FindInEmail.resx
FindInEmailIn.csproj
FindInEmailIn.csproj.user
FindInEmailIn.sln
FindInEmailIn_TemporaryKey.pfx
FindSettings.cs
FindSettings.Designer.cs
FindSettings.resx
.vs\FindInEmailIn
.vs\FindInEmailIn\v14
Properties\AssemblyInfo.cs
Properties\Resources.Designer.cs
Properties\Resources.resx
Properties\Settings.Designer.cs
Properties\Settings.settings

After a while, you realize that you want a button in the ribbon.  You will find eventually the http://www.visualstudioextensibility.com/ site where Carlos Quintero maintains various blog posts about that and understand how to add the ribbon button and how to intercept clock event . Then you wrote more or less the same code as in part 2 :

var m = Globals.ThisAddIn.Application.ActiveInspector().CurrentItem;
MailItem mi = m as MailItem;
if (mi == null)
      return;
//C# same code as in http://msprogrammer.serviciipeweb.ro/2017/01/30/developing-an-outlook-helperpart-2-from-5vba/ 

Test like it was 200x:

Press F5 to run the project. Outlook starts and loads the plugin. So now there are 2 resource hogs on your system: Outlook + Visual Studio. Set break point in VS . Open the email. Find the ribbon in Outlook. Press the button and debug.

Deploy like it was 200x:

Create a VS Setup project and pray

    1. user have the same .NET Framework version that you have developed with
    2. user have the same  Outlook version that you have developed

( There are solution for 1 and 2 to be integrated – but it requires some programming / settings)

Friday links 229

  1. 10 Free Add-ins For Microsoft Office that Improve Productivity
  2. blog.cleancoder.com/uncle-bob/2016/03/19/GivingUpOnTDD.html
  3. venturebeat.com/2016/03/20/why-indoor-location-tech-is-facing-an-uphill-battle/
  4. The Joel Test: 12 Steps to Better Code – Joel on Software
  5. https://segment.com/blog/the-deep-roots-of-js-fatigue/
  6. sethgodin.typepad.com/seths_blog/2016/03/what-are-you-competing-on.html
  7.  mperdeck/LINQtoCSV: Popular, easy to use library to read and write CSV files.
  8. DefinitelyTyped/jsnlog.d.ts at master · DefinitelyTyped/DefinitelyTyped
  9. Event processing at all scales with Reactive Extensions | Techdays 2014 the Netherlands | Channel 9
  10. Consider app.config remapping of assembly warning after upgrade with Nuget | The ASP.NET Forums
  11.  Legacy Code for Developers: Managing your Manager – NDepend
  12.  Docker Toolbox | Docker
  13. Build Lambda Expressions Dynamically – CodeProject
  14. Build Where Clause Dynamically in Linq – CodeProject
  15. Spying on Razor View Compilation
  16. Sinon Tutorial: JavaScript Testing with Mocks, Spies & Stubs
  17.  ClipX
  18. Immutability is not enough
  19. Microsoft/BotBuilder: The Microsoft Bot Builder SDK is one of three main components of the Microsoft Bot Framework. The Microsoft Bot Framework provides just what you need to build and connect intelligent bots that interact naturally wherever your users a
  20. Bot Framework Emulator
  21. Bot Framework 
  22.   evanw/thinscript: A low-level programming language inspired by TypeScript
  23. toddmotto/public-apis: A collective list of public JSON APIs for use in web development.
  24. Testing with mocha and jsdom ∙ Babel Starter Kit
  25. https://www.kriasoft.com/babel-starter-kit/recipes/testing-with-mocha-and-jsdom

Developing an outlook helper–part 2 from 5–VBA

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javascript for Office 365

Developing Outlook helper – conclusions

Develop like it was ‘9x:

In the early days to develop an outlook addon it was simple : Press ALT+F11 and wrote the VBA. ( in our days , you go to the outlook settings and enable macros)

The code will be something like this:

Public Sub IsUserInEmail()
    Dim current
    Set current = Application.ActiveInspector.CurrentItem
    
    If Not TypeOf current Is MailItem Then Exit Sub
    Dim m As MailItem
    Set m = current
    
    Dim name As String
    name = InputBox("Please give me the user name", "Find User")
    If (Len(name) = 0) Then Exit Sub
    
    
    If (InStr(1, m.To, name, vbTextCompare) > 0) Then
        MsgBox "The name " & name & " has received the email"
        Exit Sub
    End If
    If (InStr(1, m.Sender.name, name, vbTextCompare) > 0) Then
        MsgBox "The name " & name & " has received the email"
        Exit Sub
    End If
    Dim rec As Recipient
    For Each rec In m.Recipients
        If (InStr(1, rec.name, name, vbTextCompare) > 0) Then
            MsgBox "The name " & name & " has received the email"
            Exit Sub
        End If
    Next rec
    MsgBox "The name " & name & " has NOT received the email"
    
End Sub

Test like it was ‘9x:

If you want to test, open the email ( double click the email) . Then run with F5 and debug.

Deploy like it was ‘9x:

Send to the user the VBA script and tell him step by step how to copy / paste

Developing an outlook helper–part 1 from 5

Series

 

Developing Outlook helper – introduction

Developing Outlook helper-VBA macro

Developing Outlook helper-C#

Developing Outlook helper – javscript for Office 365

Developing Outlook helper – conclusions

I want to show how much the software have changed from the early days to now.

For this , I will show it was / is to develop / test / deploy a sample outlook macro/application that allows the user to find if a name is between the email addresses from an email ( in a international company this is rather a difficult task).

The part 2 will be implementation as  an Outlook VBA Macro

The part 3 will be a VS addon application

The part 4 will be a modern Javascript Office 365 application

In the part 5 I will put the conclusions – but I think that you have an idea about what I am talking.