Create Microsoft Word DOCX Files from Salesforce



Create a Microsoft Word document (.docx) with data from

This application will need to be built on a platform such as Heroku or Cloud Foundry that makes calls into, fetches the data and then generates a Word document for download.


User will be able to navigate to an opportunity record’s standard detail page and click a custom button labelled “Create Word Document”.  The user will then be directed to a new page where a newly created docx file will be downloaded to the user’s desktop.  

The user will only be required to click the single custom button.  The next dialog the user sees will be the standard browser’s download file dialog. The created docx will contain information from the Opportunity including the following fields. The exact format of the docx is up to the implementer, but should be fairly simple and straightforward.
1. Current user’s name
2. Account Name
3. Account Billing address
4. Opportunity Name
5. Opportunity Amount
6. Opportunity Description
7. Opportunity RichDescription (a custom rich text field.)

Not required but you'd receive extra credit for including an image in the Word doc that was attached to the Opportunity.


Upload all your source code as a zip (you can simply zip up your Eclipse project for convenience) and provide any documentation and/or instructions that are needed. Please be clear and concise with any setup instructions.
An SWF video of your application using Jing would also be helpful but not required.

Your submission will be judged by a panel of peers based upon this criteria. If you would like to request an extension, please read Can challenge deadlines be extended for more time? on our FAQ. We do not want to grant extensions unless there is a valid reason.



Hi Team, I am bit confused with Challenge Requirement, do we have to create word doc in salesforce and save it to local machine ? Or we have to host app on any platform that makes call to SF to fetch data and then create word doc ? Thanks
streetrep, Feb 15, 2012 at 17:07 PM reply
That is really up to you. It is unlikely you will be able to create the docx using apex. We suggest a use of a Heroku or Cloud Foundry service that makes call into Salesforce in order to retrieve the necessary data, create the docx, and then present it to the user for download.
Eric (admin), Feb 15, 2012 at 17:15 PM
The initiation of the creation should begin in Salesforce with a user clicking a custom button on the opportunity. So, you will need some way for Salesforce to callout to your service and either pass all the necessary data in the callout, or have the service use a callback mechanism in order for the service to retrieve the data.
Eric (admin), Feb 15, 2012 at 17:16 PM
So the requirement is to save the opportunity record as a docx. but not as doc? Because if its a doc, you can directly do it from salesforce itself. Not sure about docx, will do some research
logontokartik, Feb 16, 2012 at 05:59 AM reply
Correct. We are looking for an Office Open XML file. Not to be confused with the pre-2007 "Office XML" format. See this wiki-page:
Eric (admin), Feb 16, 2012 at 08:47 AM
if a pure apex/salesforce solution is possible, is this acceptable? Or, must there absolutely be a part of the solution that exists on another service(Cloudfoundry or Heroku)?
elukaweski, Feb 16, 2012 at 08:21 AM reply
A pure salesforce solution is acceptable, but keep in mind a docx file is required. We are not looking for a doc file or an html file opened with a different mime-type. We are looking for an actual Office Open XML document.
Eric (admin), Feb 16, 2012 at 08:45 AM
Does this have to run on Heroku or CloudFoundry? What about us .NET developers :)
browniepoints, Feb 20, 2012 at 10:32 AM reply
Sure! i don't see why you shouldn't be able to develop it as a .NET app as long as there is a public URL where we can test/demo it. Thanks!!
jeffdonthemic (admin), Feb 21, 2012 at 04:31 AM
simple, but procedural, question....I never figured out the hours left on the submission deadline. This says 15 hours. So, if it is now 5PM EST, does that mean that the deadline is EST 8AM tomorrow? As opposed to the end of the day?
elukaweski, Feb 21, 2012 at 13:57 PM reply
As of right now everyone is set to SF timezone. But essentially 15 hours from your current time... whatever that comes out to be.
jeffdonthemic (admin), Feb 21, 2012 at 14:07 PM

The discussion board is closed for this challenge.


18 members participating with 17 registered


Cloud Foundry | Heroku |


Ended Feb 22, 2012 at 5:00 AM
Winner Announced on March 4, 2012
View the challenge results
Give us your feedback about this challenge.


Total: $850
1st $500
2nd $250
3rd $100


Chrome Extension

Install the CloudSpokes Chrome Extension for quick and easy access to the latest CloudSpokes challenges, your payments, leaderboards and more!