<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>インデント | You Look Too Cool</title>
	<atom:link href="https://stabucky.com/wp/archives/tag/%e3%82%a4%e3%83%b3%e3%83%87%e3%83%b3%e3%83%88/feed" rel="self" type="application/rss+xml" />
	<link>https://stabucky.com/wp</link>
	<description>ゆるくつくる stabuckyのブログ</description>
	<lastBuildDate>Fri, 04 Oct 2024 14:07:02 +0000</lastBuildDate>
	<language>ja</language>
	<sy:updatePeriod>
	hourly	</sy:updatePeriod>
	<sy:updateFrequency>
	1	</sy:updateFrequency>
	<generator>https://wordpress.org/?v=6.9.4</generator>

<image>
	<url>https://stabucky.com/wp/wp-content/uploads/2024/05/cropped-stabucky-32x32.png</url>
	<title>インデント | You Look Too Cool</title>
	<link>https://stabucky.com/wp</link>
	<width>32</width>
	<height>32</height>
</image> 
	<item>
		<title>Wordのマクロでインデントを操作する方法</title>
		<link>https://stabucky.com/wp/archives/1039</link>
					<comments>https://stabucky.com/wp/archives/1039#comments</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Thu, 04 Feb 2010 14:23:08 +0000</pubDate>
				<category><![CDATA[Word]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[インデント]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=1039</guid>

					<description><![CDATA[次のコードはマイクロソフトWordのマクロ(VBA)で文書内のすべての段落のインデントを10ポイントにする例である。 Sub インデントテスト() &#160; &#160; For i = 1 To ActiveDoc [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>次のコードはマイクロソフトWordのマクロ(VBA)で文書内のすべての段落のインデントを10ポイントにする例である。<span id="more-1039"></span></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">Sub インデントテスト()<br />
&nbsp; &nbsp; For i = 1 To ActiveDocument.Paragraphs.Count<br />
&nbsp; &nbsp; &nbsp; &nbsp; a = ActiveDocument.Paragraphs(i)<br />
&nbsp; &nbsp; &nbsp; &nbsp; ActiveDocument.Paragraphs(i).Range.Select<br />
&nbsp; &nbsp; &nbsp; &nbsp; With Selection.ParagraphFormat<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .LeftIndent = 10<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .FirstLineIndent = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; End With<br />
&nbsp; &nbsp; Next i<br />
End Sub</div></div>
<p>段落の数を数え、それぞれの段落についてインデントを設定する。<br />
LeftIndentにポイント数を入れ、左インデントを設定する。<br />
FirstLineIndentは最初の行の左インデントを設定するためのもので、字下げやぶら下げをしない場合は「0」とする。</p>
<p>字下げやぶら下げをする場合は段落ダイアログを使う場合と違う挙動をするので注意を要する。</p>
<p>字下げをする場合は</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">LeftIndent = 10<br />
FirstLineIndent = 10</div></div>
<p>とする。この場合、段落全体のインデントは10ポイントで、最初の行のインデントは20ポイントになる。</p>
<pre>
□□日本国民は、正当に選挙された国会におけ
□る代表者を通じて行動し、われらとわれらの
□子孫のために、
</pre>
<p>ぶら下げをする場合は</p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">LeftIndent = 10<br />
FirstLineIndent = -10</div></div>
<p>とする。この場合、最初の行のインデントは0ポイントで、二行目以降のインデントは10ポイントとなる。<br />
つまり「LeftIndent」は二行目以降のインデントを表し、「FirstLineIndent」は最初の行のインデントと二行目以降とのインデントの差を表す。ぶら下げをする場合は、最初の行を「字上げ」すると考えると分かりやすい。</p>
<pre>
日本国民は、正当に選挙された国会における代
□表者を通じて行動し、われらとわれらの子孫
□のために、
</pre>
<p>実は、これだけならば、特にマクロを使う必要はない。<br />
コードの3行目の「a = ActiveDocument.Paragraphs(i)」の部分を使えば、文字列の内容を判断してインデントの処理を振り分ける、というような使い方ができる。<br />
なお、ここでは、インデントを直にセットする方法を書いたが、スタイルを使う方法もある。</p>
<p><img fetchpriority="high" decoding="async" src="https://stabucky.com/wp/wp-content/uploads/2011/11/word_logo.png" alt="" width="300" height="295" class="alignnone size-full wp-image-11182" /></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/1039/feed</wfw:commentRss>
			<slash:comments>4</slash:comments>
		
		
			</item>
		<item>
		<title>Wordでマクロを使って1文字下げる</title>
		<link>https://stabucky.com/wp/archives/861</link>
					<comments>https://stabucky.com/wp/archives/861#respond</comments>
		
		<dc:creator><![CDATA[stabucky]]></dc:creator>
		<pubDate>Fri, 20 Nov 2009 10:59:43 +0000</pubDate>
				<category><![CDATA[Word]]></category>
		<category><![CDATA[VBA]]></category>
		<category><![CDATA[インデント]]></category>
		<guid isPermaLink="false">http://stabucky.com/wp/?p=861</guid>

					<description><![CDATA[文章を書くときには各段落の書き始めを1文字分下げるのですが、これがなかなか面倒。 Wordならば「字下げ」を使えばよいのですが一つ問題があります。 一般的に括弧(「)で始まるときは下げません（角川文庫だけは下げるようです [&#8230;]]]></description>
										<content:encoded><![CDATA[<p>文章を書くときには各段落の書き始めを1文字分下げるのですが、これがなかなか面倒。<br />
Wordならば「字下げ」を使えばよいのですが一つ問題があります。<br />
一般的に括弧(「)で始まるときは下げません（角川文庫だけは下げるようですが）。しかしWordの「字下げ」ではこれも下げてしまいます。<br />
このように通常は1文字下げるけれども括弧のときは下げないようにするためのマクロです。<span id="more-861"></span></p>
<div class="codecolorer-container text dawn" style="overflow:auto;white-space:nowrap;border:1px solid #9F9F9F;width:400px;"><div class="text codecolorer" style="padding:5px;font:normal 12px/1.4em Monaco, Lucida Console, monospace;white-space:nowrap;">Sub 自動インデント()<br />
&nbsp; &nbsp; Dim i As Long<br />
&nbsp; &nbsp; Dim fsnormal As Single, fsfirst As Single<br />
&nbsp; &nbsp; '標準のフォントサイズを取得<br />
&nbsp; &nbsp; fsnormal = ActiveDocument.Styles(wdStyleNormal).Font.Size<br />
&nbsp; &nbsp; 'すべての段落について処理<br />
&nbsp; &nbsp; For i = 1 To ActiveDocument.Paragraphs.Count<br />
&nbsp; &nbsp; &nbsp; &nbsp; '最初の文字が&quot;「&quot;のときは字下げしない<br />
&nbsp; &nbsp; &nbsp; &nbsp; 'これ以外は標準のフォントサイズ分、字下げ<br />
&nbsp; &nbsp; &nbsp; &nbsp; If ActiveDocument.Paragraphs(i).Range.Characters(1) = &quot;「&quot; Then<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fsfirst = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; Else<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; fsfirst = fsnormal<br />
&nbsp; &nbsp; &nbsp; &nbsp; End If<br />
&nbsp; &nbsp; &nbsp; &nbsp; ActiveDocument.Paragraphs(i).Range.Select<br />
&nbsp; &nbsp; &nbsp; &nbsp; With Selection.ParagraphFormat<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .LeftIndent = 0<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; .FirstLineIndent = fsfirst<br />
&nbsp; &nbsp; &nbsp; &nbsp; End With<br />
&nbsp; &nbsp; Next i<br />
End Sub</div></div>
<p><a href='http://www.amazon.co.jp/exec/obidos/ASIN/4295005541/saigohaundesu-22'><img src='http://images-jp.amazon.com/images/P/4295005541.09.LZZZZZZZ.jpg'></a></p>
]]></content:encoded>
					
					<wfw:commentRss>https://stabucky.com/wp/archives/861/feed</wfw:commentRss>
			<slash:comments>0</slash:comments>
		
		
			</item>
	</channel>
</rss>
