Hi,
I have macro below which converts .doc to .him. Can anyone write me a VBScrpit using this or your own programmin knowledge? I would really appriciate your time.
thaks.
Sub SaveToHTML()
'
' SaveToHTML Macro
Dim inputFolder As String, outputFolder As String
Dim docFile As String, htmlFile As String
' set input and output folders here
inputFolder = "C:\Documents and Settings\"
outputFolder = "C:\Documents and Settings\Newdocs\"
'get ready to load files
'look for *.doc files
docFile = Dir(inputFolder & IIf(Right(inputFolder, 1) <> "\", "\", "") & "*.doc")
While docFile <> "" ' For each file...
' ... load the file, ...
ChangeFileOpenDirectory inputFolder
Documents.Open FileName:=docFile, ConfirmConversions:=False _
, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
' ... export it, ...
htmlFile = Left(docFile, Len(docFile) - 3) & "htm"
ChangeFileOpenDirectory outputFolder
ActiveDocument.SaveAs FileName:=htmlFile, FileFormat:= _
wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
' ... and close it.
ActiveWindow.Close
' then get next file
docFile = Dir
Wend
MsgBox "done!"
End Sub
I have macro below which converts .doc to .him. Can anyone write me a VBScrpit using this or your own programmin knowledge? I would really appriciate your time.
thaks.
Sub SaveToHTML()
'
' SaveToHTML Macro
Dim inputFolder As String, outputFolder As String
Dim docFile As String, htmlFile As String
' set input and output folders here
inputFolder = "C:\Documents and Settings\"
outputFolder = "C:\Documents and Settings\Newdocs\"
'get ready to load files
'look for *.doc files
docFile = Dir(inputFolder & IIf(Right(inputFolder, 1) <> "\", "\", "") & "*.doc")
While docFile <> "" ' For each file...
' ... load the file, ...
ChangeFileOpenDirectory inputFolder
Documents.Open FileName:=docFile, ConfirmConversions:=False _
, ReadOnly:=False, AddToRecentFiles:=False, PasswordDocument:="", _
PasswordTemplate:="", Revert:=False, WritePasswordDocument:="", _
WritePasswordTemplate:="", Format:=wdOpenFormatAuto, XMLTransform:=""
' ... export it, ...
htmlFile = Left(docFile, Len(docFile) - 3) & "htm"
ChangeFileOpenDirectory outputFolder
ActiveDocument.SaveAs FileName:=htmlFile, FileFormat:= _
wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
' ... and close it.
ActiveWindow.Close
' then get next file
docFile = Dir
Wend
MsgBox "done!"
End Sub