<?xml version="1.0" encoding="UTF-8"?><!-- generator="wordpress/2.2.1" -->
<rss version="2.0" 
	xmlns:content="http://purl.org/rss/1.0/modules/content/">
<channel>
	<title>Comments on: Macros: Text Utilities Part I</title>
	<link>http://www.openofficetips.com/2005/08/29/macros-text-utilities-part-i/</link>
	<description>My contribution to the OOo community - including a blog with daily tips, templates and scripts. Enjoy.</description>
	<pubDate>Thu, 09 Feb 2012 22:53:25 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.2.1</generator>

	<item>
		<title>By: Jo</title>
		<link>http://www.openofficetips.com/2005/08/29/macros-text-utilities-part-i/#comment-9939</link>
		<author>Jo</author>
		<pubDate>Tue, 01 Jan 2008 19:01:32 +0000</pubDate>
		<guid>http://www.openofficetips.com/2005/08/29/macros-text-utilities-part-i/#comment-9939</guid>
		<description>If you're going to post code, you should consider another blogging platform, or changing it so that it doesn't use smartypants (or whatever its using) to turn all your quotation and speech marks into facy varients that are incorrect syntax for your language</description>
		<content:encoded><![CDATA[<p>If you&#8217;re going to post code, you should consider another blogging platform, or changing it so that it doesn&#8217;t use smartypants (or whatever its using) to turn all your quotation and speech marks into facy varients that are incorrect syntax for your language</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Robin</title>
		<link>http://www.openofficetips.com/2005/08/29/macros-text-utilities-part-i/#comment-5759</link>
		<author>Robin</author>
		<pubDate>Fri, 23 Nov 2007 17:30:40 +0000</pubDate>
		<guid>http://www.openofficetips.com/2005/08/29/macros-text-utilities-part-i/#comment-5759</guid>
		<description>I also needed a "title case" so I extended your script + a script I found in the forums: http://www.oooforum.org/forum/viewtopic.phtml?t=23299

I've got limited experience with macros but this seems to work:


Sub TitleC
dim ignore as string
oDesktop = createUnoService("com.sun.star.frame.Desktop")
oDocument = ThisComponent
oSelectedCells = oDocument.CurrentSelection
oActiveCells = oSelectedCells.RangeAddress
oSheets = oDocument.Sheets
oSheet = oSheets.getByIndex(oActiveCells.Sheet) ' active table
ignore="a,the,than,with,from,of,to,and"
For nRow = oActiveCells.StartRow To oActiveCells.EndRow
For nCol = oActiveCells.StartColumn To oActiveCells.EndColumn
oCell = oSheet.getCellByPosition(nCol,nRow)
CellVal = oCell.getString()
tCaseArr = split(lcase(CellVal," "))
   for q = 0 to ubound(tCaseArr)
      if instr(ignore,tCaseArr(q)) </description>
		<content:encoded><![CDATA[<p>I also needed a &#8220;title case&#8221; so I extended your script + a script I found in the forums: <a href="http://www.oooforum.org/forum/viewtopic.phtml?t=23299" rel="nofollow">http://www.oooforum.org/forum/viewtopic.phtml?t=23299</a></p>
<p>I&#8217;ve got limited experience with macros but this seems to work:</p>
<p>Sub TitleC<br />
dim ignore as string<br />
oDesktop = createUnoService(&#8221;com.sun.star.frame.Desktop&#8221;)<br />
oDocument = ThisComponent<br />
oSelectedCells = oDocument.CurrentSelection<br />
oActiveCells = oSelectedCells.RangeAddress<br />
oSheets = oDocument.Sheets<br />
oSheet = oSheets.getByIndex(oActiveCells.Sheet) &#8216; active table<br />
ignore=&#8221;a,the,than,with,from,of,to,and&#8221;<br />
For nRow = oActiveCells.StartRow To oActiveCells.EndRow<br />
For nCol = oActiveCells.StartColumn To oActiveCells.EndColumn<br />
oCell = oSheet.getCellByPosition(nCol,nRow)<br />
CellVal = oCell.getString()<br />
tCaseArr = split(lcase(CellVal,&#8221; &#8220;))<br />
   for q = 0 to ubound(tCaseArr)<br />
      if instr(ignore,tCaseArr(q))</p>
]]></content:encoded>
	</item>
</channel>
</rss>

