Microsoft Office · Salesforce

Connect Salesforce with Microsoft office

So, I was looking through the Microsoft store where i saw Salesforce App for Outlook, which got me curious about what else can be done through the office add ins.

So below is just a demo  app I developed for exporting opportunity records in Salesforce to Microsoft Excel.

Addin 1

Step 1:

Go to Napa cloud app (you can use Visual Studio too for this but Napa being an in browser IDE is easier to use) and login through your Microsoft email id (if you don’t have one create one) , and select Content Add-in for Office , give a meaningful name to your project and then click create

Step 2:

You will notice three files (home.js, home.html , home.css) already present in your project directory with some sample code written in it.

First we will add some styling to our page so go ahead and open home.css and paste the below code there

/* Page-specific styling */
.option {
    padding: 6px;
    border-top: 1px dotted #CCC;
    cursor: pointer;

.option:last-child {
    border-bottom: 1px dotted #CCC;

.option:hover {
    background-color: #DFEEF9;
} {
    background-color: #BFDDF2

Step 3:

Now we will look into the layout of the page ,open home.html  and locate                                  <div class=”padding”> element in it , delete everything present in it and then paste the below code

<p>Please select the opportunity stage(s) you want to export:</p>
    <div class="option">Prospecting</div>
    <div class="option">Qualification</div>
    <div class="option">Needs Analysis</div>
    <div class="option">Value Proposition</div>
    <div class="option">Id. Decision Makers</div>
    <div class="option">Perception Analysis</div>
    <div class="option">Proposal/Price Quote</div>
    <div class="option">Negotiation/Review</div>
    <div class="option">Closed Won</div>
    <div class="option">Closed Lost</div>
<button id="btnExport">Export to Excel</button>

And after doing that add a script reference just after office.js script reference

<script src="" type="text/javascript"></script>

Step 4:

Now open home.js in your project directory and then paste the script attached below in the document


Step 5:

Click on run project button on your left toolbar and then select some of the stage types and then click on export to excel button .

Congratulations, you are done with your first Salesforce addin for Microsoft excel




Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s