problème avec vb.net et openxml
bonjour
j'ai créé une classe qui me permet de créer un document word avec open xml;ma classe fonctionne bien et mon doc est généré,mais mon probleme c'est que la classe de modificetion de contenue me génére toujours des exception
et voilà le code
Imports System.IO.Packaging
Imports System.IO
Imports System.Xml
Public Class ajouter_text
Dim aj As New creation_documentword
Sub ajout()
aj = New creation_documentword
Try
Dim nodetexte As XmlNode = aj.xmlStartPart.CreateNode(XmlNodeType.Text, "w:t", aj.WordprocessingML)
aj.pkgOutputDoc = Package.Open("monFichier.docx", FileMode.Open, FileAccess.ReadWrite)
nodetexte.Value = "Salut !"
'MsgBox("eee")
'aj.tagText.AppendChild(nodetexte)
MsgBox("eee")
aj.pkgOutputDoc.CreateRelationship(aj.docuri, TargetMode.Internal, "http://schemas.openxmlformats.org/officeDocument/2006/relationships/officeDocument", "rId1")
aj.pkgOutputDoc.Flush()
aj.pkgOutputDoc.Close()
Catch ex As Exception
MsgBox(ex.Message)
End Try
End Sub
End Class
Merci pour toute idée et aide.