Imports Word = Microsoft.Office.Interop.Word
Public Class historic
'note
Private Sub PublipostageNoteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PublipostageNoteToolStripMenuItem.Click
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
'Start Word and open the document template.
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
Try
'Insertion de paragraphes.
oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "MINISTERE AUPRES DU PREMIER MINISTRE "
oPara1.Range.Font.Bold = True
oPara1.Format.SpaceAfter = 2 '4 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter()
pied de page
Try
oDoc.Sections(1).PageSetup.DifferentFirstPageHeaderFooter = True
'ce Footers en gras vous pouvez le changer en Headers et il de vient un haut de page
With oDoc.Sections(1).[B]Footers/B(Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage).Range
.Text = " Inspection Générale des Finances, Abidjan Plateau, Boulevard Angoulvant, 19 Clozel à l'angle, Avenue A58 Docteur" + vbCrLf + _
" Adresse postale : 04 BP 2876 Abidjan 04 Téléphone : 20 22 51 56 / 20 21 60 16 Fax : 20 21 10 80"
.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
.Font.Size = 9
.InlineShapes.AddHorizontalLineStandard()
End With
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class
Imports Word = Microsoft.Office.Interop.Word
Public Class historic
'note
Private Sub PublipostageNoteToolStripMenuItem_Click(sender As Object, e As EventArgs) Handles PublipostageNoteToolStripMenuItem.Click
Dim oWord As Word.Application
Dim oDoc As Word.Document
Dim oPara1 As Word.Paragraph, oPara2 As Word.Paragraph
'Start Word and open the document template.
oWord = CreateObject("Word.Application")
oWord.Visible = True
oDoc = oWord.Documents.Add
Try
'Insertion de paragraphes.
oPara1 = oDoc.Content.Paragraphs.Add
oPara1.Range.Text = "MINISTERE AUPRES DU PREMIER MINISTRE "
oPara1.Range.Font.Bold = True
oPara1.Format.SpaceAfter = 2 '4 pt spacing after paragraph.
oPara1.Range.InsertParagraphAfter()
Catch ex As Exception
MsgBox(ex.ToString)
End Try
' pied de page
Try
oDoc.Sections(1).PageSetup.DifferentFirstPageHeaderFooter = True
'ce Footers en gras vous pouvez le changer en Headers et il de vient un haut de page
With oDoc.Sections(1).Footers(Word.WdHeaderFooterIndex.wdHeaderFooterFirstPage).Range
.Text = " Inspection Générale des Finances, Abidjan Plateau, Boulevard Angoulvant, 19 Clozel à l'angle, Avenue A58 Docteur" + vbCrLf + _
" Adresse postale : 04 BP 2876 Abidjan 04 Téléphone : 20 22 51 56 / 20 21 60 16 Fax : 20 21 10 80"
.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphLeft
.Font.Size = 9
.InlineShapes.AddHorizontalLineStandard()
End With
Catch ex As Exception
MsgBox(ex.ToString)
End Try
End Sub
End Class