回答編集履歴
2
リンクの変更
test
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
[Free Spire.Doc for .NET](https://
|
1
|
+
[Free Spire.Doc for .NET](https://jp.e-iceblue.com/introduce/free-spire-doc-for-net.html)
|
2
2
|
この製品にはフッターに画像を挿入する機能があります。
|
3
3
|
無料版があります。
|
4
4
|
https://www.e-iceblue.com/Tutorials/Spire.Doc/Spire.Doc-Program-Guide/Word-Header/Footer-Insert-Image-Header-and-Footer-for-Word.html
|
1
コードの変更
test
CHANGED
@@ -1,39 +1,36 @@
|
|
1
1
|
[Free Spire.Doc for .NET](https://www.e-iceblue.cn/Introduce/Free-Spire-Doc-NET.html)
|
2
2
|
この製品にはフッターに画像を挿入する機能があります。
|
3
3
|
無料版があります。
|
4
|
-
|
4
|
+
https://www.e-iceblue.com/Tutorials/Spire.Doc/Spire.Doc-Program-Guide/Word-Header/Footer-Insert-Image-Header-and-Footer-for-Word.html
|
5
|
+
|
5
6
|
```ここに言語を入力
|
6
|
-
|
7
|
+
Imports System.Drawing
|
7
|
-
|
8
|
+
Imports Spire.Doc
|
8
|
-
|
9
|
+
Imports Spire.Doc.Documents
|
9
|
-
|
10
|
+
Imports Spire.Doc.Fields
|
10
11
|
|
11
|
-
|
12
|
+
Namespace ImageHeaderFooter
|
12
|
-
{
|
13
|
-
|
13
|
+
Friend Class Program
|
14
|
-
{
|
15
|
-
|
14
|
+
Shared Sub Main(ByVal args() As String)
|
16
|
-
{
|
17
|
-
|
15
|
+
'ドキュメントのロード
|
18
|
-
D
|
16
|
+
Dim document As New Document()
|
19
|
-
document.LoadFromFile(
|
17
|
+
document.LoadFromFile("E:\Work\Documents\Spire.Doc for .NET.docx")
|
20
18
|
|
19
|
+
'Footerインスタンスの初期化
|
20
|
+
Dim footer As HeaderFooter = document.Sections(0).HeadersFooters.Footer
|
21
|
+
'フッターに段落と書式設定を追加する
|
22
|
+
Dim paragraph2 As Paragraph = footer.AddParagraph()
|
23
|
+
paragraph2.Format.HorizontalAlignment = HorizontalAlignment.Left
|
24
|
+
'フッター段落に画像とテキストを追加する
|
25
|
+
Dim footerimage As DocPicture = paragraph2.AppendPicture(Image.FromFile("E:\Logo\logo.jpeg"))
|
26
|
+
Dim TR As TextRange = paragraph2.AppendText("Copyright © 2013 e-iceblue. All Rights Reserved.")
|
27
|
+
TR.CharacterFormat.FontName = "Arial"
|
28
|
+
TR.CharacterFormat.FontSize = 10
|
29
|
+
TR.CharacterFormat.TextColor = Color.Black
|
21
30
|
|
22
|
-
//Footerインスタンスの初期化
|
23
|
-
HeaderFooter footer = document.Sections[0].HeadersFooters.Footer;
|
24
|
-
//フッターの段落と書式設定の追加
|
25
|
-
Paragraph paragraph2 = footer.AddParagraph();
|
26
|
-
paragraph2.Format.HorizontalAlignment = HorizontalAlignment.Left;
|
27
|
-
//フッター段落に画像とテキストを追加する
|
28
|
-
DocPicture footerimage = paragraph2.AppendPicture(Image.FromFile(@"E:\Logo\logo.jpeg"));
|
29
|
-
TextRange TR = paragraph2.AppendText("Copyright © 2013 e-iceblue. All Rights Reserved.");
|
30
|
-
TR.CharacterFormat.FontName = "Arial";
|
31
|
-
TR.CharacterFormat.FontSize = 10;
|
32
|
-
TR.CharacterFormat.TextColor = Color.Black;
|
33
|
-
|
34
|
-
document.SaveToFile("ImageHeaderFooter.docx", FileFormat.Docx)
|
31
|
+
document.SaveToFile("ImageHeaderFooter.docx", FileFormat.Docx)
|
35
|
-
System.Diagnostics.Process.Start("ImageHeaderFooter.docx")
|
32
|
+
System.Diagnostics.Process.Start("ImageHeaderFooter.docx")
|
36
|
-
|
33
|
+
End Sub
|
37
|
-
|
34
|
+
End Class
|
38
|
-
|
35
|
+
End Namespace
|
39
36
|
```
|