MIME タイプ application/msword を使用して動的に生成されたドキュメントにページ番号を追加するにはどうすればよいですか?
2249 次
1 に答える
2
はい、動的に生成されたドキュメントにページ番号を追加できます。コードを取得するには 新しいドキュメントを開きます ヘッダー/フッターでページ番号を有効にし、単一ページの Web ページ (*.htm) として保存します 結果のファイルを任意のテキスト エディター (メモ帳など) で開きます コードを分析し、ページを表示するコードを取得します番号。ここでは、ページ番号を Page 1 of 15 のように表示しようとしました。これが*.htmファイルから取得したコードです。注:関連するスタイルもコピーする必要がある場合があります。
<style>
@page Section1
{
size:11.0in 8.5in;
mso-footer: url("http://images/footer.htm")f1;
mso-header: url("http://images/header.htm")h1;
mso-page-orientation:landscape;
margin:0.3in 0.5in 0.4in 0.5in;
mso-header-margin:.2in;
mso-footer-margin:.2in;
mso-paper-source:0;
font-family:Gill Sans MT, Times New Roman, Trebuchet MS;
}
div.Section1
{ page:Section1;}
@page Section2
{
size:11.0in 8.5in;
mso-footer: url("http://images/footer.htm")f1;
mso-header: url("http://images/header2.htm")h2;
mso-page-orientation:landscape;
margin:0.3in 0.5in 0.4in 0.5in;
mso-header-margin:.2in;
mso-footer-margin:.2in;
mso-paper-source:0;
font-family:Gill Sans MT, Times New Roman, Trebuchet MS;
}
</style>
-------------
------=_NextPart_000_0019_01CA5EDF.DC424910
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Content-Location: http://images/footer.htm
<!--[if supportFields]>
<div style=3D'mso-element:footer;' id=3D'f1'>
<p class=3D'MsoFooter' style=3D'border:none;mso-border-bottom-alt:solid windowtext .75pt;padding:0in;mso-padding-alt:0in 0in 1.0pt 0in'>
<table border=3D"0" width=3D"100%" cellpadding=3D"0" cellspacing=3D"0">
<tr>
<td width=3D"25%" align=3D"right"style=3D"font-family:Gill Sans MT, Times New Roman, Trebuchet MS;font-size:16pt;color:#6cbc48;font-weight:bold;padding:7px 30px 0px 0px;" valign=3D"middle">
Page <span style=3D'**mso-field-code: PAGE**' ></span> of <span style=3D'**mso-field-code:NUMPAGES** '></span>
</td>
</tr>
</table>
于 2011-05-05T08:17:59.460 に答える