Code:
Sub Makro7()
'
' Makro7 Makro https://excelfox.com/forum/showthread.php/2348-Just-Testing-Passing-info-between-Word-and-Excel?p=15643&viewfull=1#post15643
'
' OPs original file
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\"
Documents.Open Filename:="""2. KEEP DUPLICATE RECORDS.docx""", ConfirmConversions:=False, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:="", DocumentDirection:=wdLeftToRight
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\Original OP File\"
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
' OPs file with dot in name changed to underscore
RecentFiles(3).Open
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\Ops File with dot in name changed to underscore\"
ActiveDocument.SaveAs Filename:="2_ KEEP DUPLICATE RECORDS.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2_ KEEP DUPLICATE RECORDS.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
' File in Office 97 - 2003 format
RecentFiles(3).Open
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\Ops file in 97 -2003 format\"
ActiveDocument.SaveAs Filename:="2_ KEEP DUPLICATE RECORDS.doc", FileFormat:=wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2_ KEEP DUPLICATE RECORDS.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
' Ops file no images
RecentFiles(3).Open
Selection.MoveDown Unit:=wdLine, Count:=6
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=4
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
Selection.MoveDown Unit:=wdLine, Count:=2
Selection.TypeBackspace
Selection.TypeBackspace
Selection.TypeBackspace
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\Ops File no images\"
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS no images.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS no images.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
' Empty OP file
RecentFiles(3).Open
Selection.WholeStory
Selection.TypeBackspace
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\OPs file empty\"
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS empty.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS empty.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="2. KEEP DUPLICATE RECORDS empty.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
' Virgin file
Documents.Add Template:="Normal", NewTemplate:=False, DocumentType:=0 ' make file
ChangeFileOpenDirectory "F:\Excel0202015Jan2016\ExcelFox\Word\prkhan56\Virgin empty file\"
ActiveDocument.SaveAs Filename:="Dok2.docx", FileFormat:=wdFormatXMLDocument, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveDocument.SaveAs Filename:="Dok2.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
ActiveWindow.View.Type = wdWebView
ActiveDocument.Close ' close the .htm file
End Sub
Here is the files produced
Bookmarks