Creer document WORD avec vb.net

cs_chris81 Messages postés 589 Date d'inscription jeudi 2 octobre 2003 Statut Membre Dernière intervention 29 avril 2008 - 15 mars 2005 à 13:39
BouraouiBenhenia Messages postés 1 Date d'inscription samedi 5 avril 2008 Statut Membre Dernière intervention 25 décembre 2009 - 25 déc. 2009 à 16:16
bonjour,

comment fait on pour creer un document a partir de vb.net



merci

http://www.correzeweb.com
http://www.localetv.com

1 réponse

BouraouiBenhenia Messages postés 1 Date d'inscription samedi 5 avril 2008 Statut Membre Dernière intervention 25 décembre 2009
25 déc. 2009 à 16:16
Set objWord = CreateObject("Word.Application")
Set docWord = objWord.Documents.Open(".\Facture.docx")
docWord.Activate
With objWord
.Visible = True
.ActiveDocument.Shapes.AddTextbox(msoTextOrientationHorizontal, 180, 120, 400, 55).Select 'crée un cadre position gauche deroit 600 / position haut bas 800 / largeur / longeur
'crée un cadre position gauche deroit 600 / position haut bas 800 / largeur / longeur
.Selection.ShapeRange.Line.Visible = msoFalse ' rend le cadre invisible

'.Selection.Range.ShapeRange.Adjustments.Item


.Selection.ShapeRange.TextFrame.TextRange.Select
.Selection.Collapse
.Selection.Font.Name = "Times New Roman"
.Selection.Font.Size = 20
.Selection.Font.Bold = True
.Selection.TypeText text:="Client : " & Facture_devi.NomClient.text

.Selection.TypeParagraph
.Selection.Font.Size = 10

.Selection.TypeText text:=Facture_devi.Text1.text
End With
End With
0
Rejoignez-nous