OfficeDoc reads/writes/appends and formats data, images & figure screenshots in Microsoft Office documents, from within the Matlab environment. Supported document formats include XLS (Excel), DOC (Word) & PPT (PowerPoint). Opening/closing COM server connection and files is user-controllable, enabling very fast sequential writes. Numerous format properties enable highly customizable output.
This function is meant as a direct replacement for Matlab's built-in xlsread/xlswrite functions. There is no comparable built-in Matlab support for DOC/PPT.
OfficeDoc has 2 basic syntaxes:
The first syntax is the main usage form. Due to the vast number of possible actions and properties, an extensive documentation facility was built-in: the second syntax form above.
- [data,status,errMsg] = officedoc(file, action, propName,propVal, ...)
- actions: 'open'/'read'/'write'/'format'/'close'/'display'
- properties: 66 different props - too many to list here (see inline documentation). The Professional version enables all properties, whereas the demo version enables only a handful. Click here to see the full list of properties.
- helpText = officedoc('help', helpType)
- helpTypes: 'props'/'examples'/'xls'/'doc'/'ppt'
OfficeDoc comes a long way in enabling highly customizable document output. However, there will always be certain unsupported capabilities. The built-in documentation provides examples on accessing and using such features via direct COM calls.
A basic usage example follows. Click here for more detailed examples:
>> [file,status] = officedoc(fileName, 'open', 'mode','append');
>> status = officedoc(file, 'write', 'title','My data', 'data',[1,2;3,4], 'image',gcf, 'bold',1,'fgcolor','b');
>> status = officedoc(file, 'close');
Bugs and suggestions:
OfficeDoc was tested on Office 11 (XP) & Matlab 6.0 (R12) - 7.4 (R2007a), but might also work on earlier versions of Matlab & Office. OfficeDoc was only tested on Windows PC, and is expected to fail on other systems. Please report any incompatibilities or other bugs/suggestions to YMASoftware@gmail.com.
Download and unzip the officedoc.zip file, and place the file's contents anywhere on your Matlab path. The same file is used for both Demo and Pro versions. To unlock the Pro features, purchase a license here and follow the instructions below.
After initial installation, you can always download the latest OfficeDoc version here - you will not need to reinstall your license access code.
In order to receive the license (access code) that will unlock the professional features of OfficeDoc, please send an email with the following details to YMASoftware@gmail.com:
- your Matlab license number (output of the license command)
- your full name as entered during purchase
- your OfficeDoc order confirmation number and date
After receiving your information, your OfficeDoc Pro license (access code) will be sent to you within 2 business days. Purchasing an OfficeDoc Pro license entitles you (the Licensee) to a single access code, on a single computer running the Matlab license that you specified in your email. You are also entitled to email notifications of any upgraded version or fixes, free of charge (unless, of course, you choose to unsubscribe).
Non-professional Matlab licenses (e.g., student or demo) are not entitled to OfficeDoc Pro.
This Program is delivered "as-is" and YMA Software makes and the Licensee receives no additional express or implied warranties. YMA Software and its Licensors hereby expressly disclaim any and all other conditions, warranties, or other terms of any kind or nature concerning the Programs, Documentation, and Software Maintenance Services (including, without limitation, any with regard to infringement, merchantability, quality, accuracy, or fitness for a particular purpose or Licensee's purpose). YMA Software also expressly disclaims any warranties that may be implied from usage of trade, course of dealing, or course of performance. The Programs, Documentation, and Software Maintenance Services are provided with all faults, and the entire risk of satisfactory quality, performance, accuracy, and effort is with Licensee. YMA Software does not warrant that the Programs and Documentation will operate without interruption or be error free. Licensee accepts responsibility for its use of the Programs and the results obtained therefrom.