rainbowtuner
12-11-2012, 11:46 AM
Dear m8s,
Grettings from the snowy hills in Innsbruck - Austria!
Glad to found this forum - with a lot of help in it. :help
Always found help here when I searched for something specific for my work - others, too, had the same problems or I found a much easier way to do it.
Actually I am working on an Excel macro - and I am going crazy... :banghead: I have created a Word.docx formular and I connected every Tagged Content Field with an .xml root knot. Sorry for my English - it's hard to finde the special expressions. However, instead of opening every .docx and save the form field as .txt I'd like to have this macro working - but i cannot find my mistake why its not running. :dunno
So maybe one of you guys is much smater than me - and could help me to get it running. I' ve already tried it in an German forum - although I do not like the Germans very much - but, it seems that none of them is working with .docx, formulars, tagged content, xml and analysing everything in excel. So, worse a try - first, i have found an article helping me in some kinds maybe it will help you or anybody else experiencing the same problems
and solving questions (although it is in german: BUT I CANNOT POST LINKS untill now).
And now the mysterious vba:
Public gstrheutigesDatum As String
Public gstrVorname As String
Public gstrNachname As String
Public gstrOrganisationseinheit As String
Public gstrMitarbeiter As String
Public gstrTitel As String
Public gstrZustand As String
Public gstrUmsetzung As String
Public gstrNutzen As String
Public gstrEuro As String
Public gstrStunden As String
Public gstrbetrifft As String
Public gstrdurch As String
Sub Test()
Set wrdWordApplication = CreateObject("Word.Application")
Set ofdDateiDialog = Application.FileDialog(msoFileDialogFilePicker)
With ofdDateiDialog
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Next vrtSelectedItem
Else
End If
End With
For Each cxmlCustomXML In docDocument.CustomXMLParts
If cxmlCustomXML.BuiltIn = False Then
Set nxmlXMLNode = cxmlCustomXML.SelectSingleNode(cXMLKnotenRoot)
If Not nxmlXMLNode Is Nothing Then
Exit For
End If
End If
Next cxmlCustomXML
If Not cxmlCustomXML Is Nothing Then
pDatenAusXMLStrukturAuslesen
cxmlvCustomXML = cxmlCustomXML
pDatenInExcelEinfügen
End If
wrdWordApplication.Quit
Set wrdWordApplication = Nothing
This Workbook.Save
End Sub
Sub pDatenAusXMLStrukturAuslesen()
gstrheutigesDatum = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/heutigesDatum").Result
gstrVorname = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Vorname").Result
gstrNachname = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Nachname").Result
gstrOrganisationseinheit = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Organisationseinheit").Result
gstrMitarbeiter = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Mitarbeiter").Result
gstrTitel = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Titel").Result
gstrZustand = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Zustand").Result
gstrUmsetzung = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Umsetzung").Result
gstrNutzen = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Nutzen").Result
gstrEuro = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Euro").Result
gstrStunden = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Stunden").Result
gstrbetrifft = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/betrifft").Result
gstrdurch = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/durch").Result
End Sub
Sub pDatenInExcelEinfügen()
Sheets("Tabelle1").Select
Range("A2").Select
If Trim(ActiveCell.Value) <> "" Then
Range("A1").Select
Selection.End(xlDown).Select
Else
Range("A1").Select
End If
End Sub
So, m8s, I stronly hope that anybody can help me to get this little code running :bow: - i do not have any advisse how to go on without help and it is really important for me. Otherwise I will have a lot of work to do. And maybe there is a way to send u some beer from here :beerchug:. Let me know if u have any questions concerning this little work!
Have a nice evening. Hope to hear some help from u and i will post a link a little bit later - after 4 more posts.
Chears
Chris
Grettings from the snowy hills in Innsbruck - Austria!
Glad to found this forum - with a lot of help in it. :help
Always found help here when I searched for something specific for my work - others, too, had the same problems or I found a much easier way to do it.
Actually I am working on an Excel macro - and I am going crazy... :banghead: I have created a Word.docx formular and I connected every Tagged Content Field with an .xml root knot. Sorry for my English - it's hard to finde the special expressions. However, instead of opening every .docx and save the form field as .txt I'd like to have this macro working - but i cannot find my mistake why its not running. :dunno
So maybe one of you guys is much smater than me - and could help me to get it running. I' ve already tried it in an German forum - although I do not like the Germans very much - but, it seems that none of them is working with .docx, formulars, tagged content, xml and analysing everything in excel. So, worse a try - first, i have found an article helping me in some kinds maybe it will help you or anybody else experiencing the same problems
and solving questions (although it is in german: BUT I CANNOT POST LINKS untill now).
And now the mysterious vba:
Public gstrheutigesDatum As String
Public gstrVorname As String
Public gstrNachname As String
Public gstrOrganisationseinheit As String
Public gstrMitarbeiter As String
Public gstrTitel As String
Public gstrZustand As String
Public gstrUmsetzung As String
Public gstrNutzen As String
Public gstrEuro As String
Public gstrStunden As String
Public gstrbetrifft As String
Public gstrdurch As String
Sub Test()
Set wrdWordApplication = CreateObject("Word.Application")
Set ofdDateiDialog = Application.FileDialog(msoFileDialogFilePicker)
With ofdDateiDialog
If .Show = -1 Then
For Each vrtSelectedItem In .SelectedItems
Next vrtSelectedItem
Else
End If
End With
For Each cxmlCustomXML In docDocument.CustomXMLParts
If cxmlCustomXML.BuiltIn = False Then
Set nxmlXMLNode = cxmlCustomXML.SelectSingleNode(cXMLKnotenRoot)
If Not nxmlXMLNode Is Nothing Then
Exit For
End If
End If
Next cxmlCustomXML
If Not cxmlCustomXML Is Nothing Then
pDatenAusXMLStrukturAuslesen
cxmlvCustomXML = cxmlCustomXML
pDatenInExcelEinfügen
End If
wrdWordApplication.Quit
Set wrdWordApplication = Nothing
This Workbook.Save
End Sub
Sub pDatenAusXMLStrukturAuslesen()
gstrheutigesDatum = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/heutigesDatum").Result
gstrVorname = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Vorname").Result
gstrNachname = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Nachname").Result
gstrOrganisationseinheit = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Organisationseinheit").Result
gstrMitarbeiter = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Mitarbeiter").Result
gstrTitel = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Titel").Result
gstrZustand = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Zustand").Result
gstrUmsetzung = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Umsetzung").Result
gstrNutzen = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Nutzen").Result
gstrEuro = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Euro").Result
gstrStunden = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/Stunden").Result
gstrbetrifft = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/betrifft").Result
gstrdurch = cxmlvCustomXML.SelectSingleNode(cXMLKnotenRoot & "/durch").Result
End Sub
Sub pDatenInExcelEinfügen()
Sheets("Tabelle1").Select
Range("A2").Select
If Trim(ActiveCell.Value) <> "" Then
Range("A1").Select
Selection.End(xlDown).Select
Else
Range("A1").Select
End If
End Sub
So, m8s, I stronly hope that anybody can help me to get this little code running :bow: - i do not have any advisse how to go on without help and it is really important for me. Otherwise I will have a lot of work to do. And maybe there is a way to send u some beer from here :beerchug:. Let me know if u have any questions concerning this little work!
Have a nice evening. Hope to hear some help from u and i will post a link a little bit later - after 4 more posts.
Chears
Chris