日期:2013-04-15  浏览次数:20376 次

这是WORD排版的范例,大标题,二标题,接着左右分左右两边段落。
可以应用在在线排版系统,但是系统一定要是Windows + MSOffice。

 
<?
$word = new COM("word.application") or die("无法启动 Word 程序!"
);

$word->Visible 0
;

$n=$word->Documents->Add
();

## 分节符号
$n->Sections->Add($word->Selection->Range,0
);

## Sections(1)第一小节
$s1=$n->Sections(1
);
$s1->PageSetup->BottomMargin=10
;


## Paragraphs(1) 第一段落
$s1->Range->InsertBefore("企鹅帝国元年-诗词多首排版测试"
);
$s1->Range->InsertParagraphAfter
;
$s1->Range->InsertBefore("大标题-诗词歌赋\n"
);

$Para=$n->Paragraphs(1
);
$Para->Alignment=1
;
$font_style=$Para->Range
;
$font_style