Good Day All how to create new Word 2010 XML Format and later by create folders are need and fill with required XML
thanks
thanks
Code:
Sub creatWordXml()
Dim FilePath As String, docPropsFolder As String, relsFolder As String, wordFolder As String, relsFolder1 As String, themeFolder As String
Dim objShell As Object
Dim strWordExe As String
Set objShell = CreateObject("WScript.Shell")
strWordExe = objShell.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\App Paths\Winword.exe\")
FilePath = ThisWorkbook.Path & "\"
'Folders Path
RootFolder = FilePath & "root"
docPropsFolder = RootFolder & "\" & "docProps"
relsFolder = RootFolder & "\" & "_rels"
wordFolder = RootFolder & "\" & "word"
relsFolder1 = wordFolder & "\" & "_rels"
themeFolder = wordFolder & "\" & "theme"
' creat Folders
If Len(Dir(RootFolder, vbDirectory)) = 0 Then MkDir RootFolder
If Len(Dir(relsFolder, vbDirectory)) = 0 Then MkDir relsFolder
If Len(Dir(docPropsFolder, vbDirectory)) = 0 Then MkDir docPropsFolder
If Len(Dir(wordFolder, vbDirectory)) = 0 Then MkDir wordFolder
If Len(Dir(wordFolder, vbDirectory)) = 0 Then MkDir wordFolder
If Len(Dir(wordFolder, vbDirectory)) = 0 Then MkDir wordFolder
If Len(Dir(relsFolder1, vbDirectory)) = 0 Then MkDir relsFolder1
If Len(Dir(themeFolder, vbDirectory)) = 0 Then MkDir themeFolder
''' Here I want macro to get below XML
'.rels
'app.XML
'core.XML
'custum.XML
'document.XML.rels
'theme.xml........and other
'[Content_Types].XML
Shell strWordExe & " " & FilePath & "\" & "New Word.docx", vbMaximizedFocus
End Sub