Hi miteinander,
ICh lese mit meinem Programm eine Word-Tabelle folgendermaßen aus:
Etext1 = ActiveDocument.Tables(1).Rows(a_counter).Cells(2).Range
und übergebe dieses Rangeobjekt einer Subfunktion, die versucht den FormattedText innerhalb von Etext1 in ein neues Worddokument zu schreiben
Private Function CreateWordFile(ArtNr1 As String, Bezeichnung1 As String, Etext1 As Range)
Debug.Print ("Inside creatingWordFile......")
' add a reference to the Word-library
Dim wrdApp As Word.Application
Dim wrdDoc As Word.Document
Dim wrdTable As Word.Table
Dim xText
Set wrdApp = CreateObject("Word.Application")
Set wrdDoc = wrdApp.Documents.Add ' create a new document
Debug.Print (Etext1.FormattedText)
Dim tex As String
wrdDoc.Range.FormattedText = Etext1.FormattedText
wrdDoc.SaveAs ("D:\MarcelHamade\_output\_" & ArtNr1 & ".doc")
wrdDoc.Close
wrdApp.NormalTemplate.Saved = True
wrdApp.Quit
End Function
Leider kriege ich den Fehler : "Keine Artenübereinstimmung und das liegt an der Zeile
wrdDoc.Range.FormattedText = Etext1.FormattedText
|