' 各用紙サイズにつき 1 つのページを作成します
Dim firstPage As Boolean = True
For Each pk As PaperKind In [Enum].GetValues(GetType(PaperKind))
' Silverlight には Enum.GetValues はありません
'PaperKind pk = fi;
' カスタムサイズはスキップします
If pk = PaperKind.[Custom] Then
Continue For
End If
' 最初のページ以降のすべてのページに新しいページを追加します
If Not firstPage Then
word.PageBreak()
End If
firstPage = False
' 用紙の種類と向きを設定します
'word.PaperKind = pk;
word.Landscape = Not word.Landscape
' コンテンツをページに描画します
rc = WordUtils.PageRectangle(word)
rc = WordUtils.Inflate(rc, -6, -6)
'string text = string.Format(Strings.StringFormatTwoArg, word.PaperKind, word.Landscape);
Dim text As String = String.Format(Strings.StringFormatTwoArg, pk, word.Landscape)
word.DrawString(text, font, Colors.Black, rc, sf)
word.DrawRectangle(Colors.Black, rc)
Next