1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
| Imports Microsoft.Office.Interop
Public Class Form1
Private Sub Button1_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles Button1.Click
Dim WordApp As New Word.Application
Dim Doc As Word.Document = WordApp.Documents.Add()
Dim Plage As Word.Range = Doc.Range(0, 0)
Plage.Text = "bidou.developpez.com"
Plage.Font.Bold = Word.WdConstants.wdToggle
Plage.ParagraphFormat.Alignment = Word.WdParagraphAlignment.wdAlignParagraphCenter
Plage.InsertParagraphAfter()
Plage = Plage.Next(Word.WdUnits.wdParagraph, 1)
Plage.InlineShapes.AddPicture(My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\bidou.jpg", LinkToFile:=False, SaveWithDocument:=True)
Plage.InsertParagraphAfter()
Plage = Doc.Range(Doc.StoryRanges(Word.WdStoryType.wdMainTextStory).End - 1, Doc.StoryRanges(Word.WdStoryType.wdMainTextStory).End - 1)
Plage.InsertFile(FileName:=My.Computer.FileSystem.SpecialDirectories.MyDocuments & "\Traduction1.doc", Range:="", ConfirmConversions:=False, Link:=False, Attachment:=False)
WordApp.Visible = True
End Sub
End Class |
Partager