Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Matlab ActiveX command for PowerPoint Multiline Title
Date: Thu, 19 Jul 2007 05:51:24 +0000 (UTC)
Organization: TACT Computer Systems Ltd
Lines: 17
Message-ID: <f7mu4s$es5$1@fred.mathworks.com>
References: <f7lole$dhk$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-00-blr.mathworks.com
Content-Type: text/plain; charset="ISO-8859-1"
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1184824284 15237 172.30.248.35 (19 Jul 2007 05:51:24 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Thu, 19 Jul 2007 05:51:24 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader qá¡ÂÑ>
Xref: news.mathworks.com comp.soft-sys.matlab:419800



> Does anyone know how to use activeX in Maltab so that
> you can write a multiline title text?
>
> Here's an excerpt of the code I'm using.
>
>   titletext=sprintf('LINE1\nline2');


Microsoft Office uses char(13) to split multi-line strings. Matlab's sprintf() uses char(10) for '\n', which is the reason it didn't work for you. So, do this instead:

  titletext = ['LINE1' char(13) 'line2'];

You might wish to try out OfficeDoc (http://www.mathworks.com/matlabcentral/fileexchange/loadFile.do?objectId=15192) in order to read/write/format PowerPoint and other MS Office documents without the hassle of low-level programming.

Yair Altman
http://www.ymasoftware.com