General question: how can functionality in VBA macros created by 'recording' in Microsoft Office be 'translated' into Windows-executable VBScripts that could be in .vbs files?
Specific question: how to batch create thumbnails of Word documents for viewing in Windows Explorer?
Alternative question: where can i find documentation on manipulating MS Word documents with VBS?
my final goal is to batch the process of creating thumbnails for MS Word docs.
my humanly-done method is:
- open a Word doc
- press 'save as'
- tick 'save thumbnail'
- save and replace
i found out from a small website that VBS, in the form of .vbs files, can manipulate Word documents. example that can be executed by double clicking the .vbs file in Windows Explorer:
'in a file called "something.vbs"
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
Set objDoc = objWord.Documents.Add()
Set objSelection = objWord.Selection
objSelection.Font.Name = "Arial"
objSelection.Font.Size = "18"
objSelection.TypeText "Network Adapter Report"
objSelection.TypeParagraph()
objSelection.Font.Size = "14"
objSelection.TypeText "" & Date()
objSelection.TypeParagraph()
i also found out that by 'recording macros', i can get some VBA code that saves a document with a thumbnail. here is a macro that i recorded:
Sub save_with_thumbnail()
'
' save_with_thumbnail Macro
'
'
ChangeFileOpenDirectory _
"E:\"
ActiveDocument.SaveAs2 FileName:="as90520.doc", FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="", AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=0
End Sub
each of the two approaches solve part of my problems, but i couldn't integrate them two. therefore i'm asking if anyone -
- can help integrate/combine/whatever the two approaches by converting what the VBA macro did into a windows-executable script, or
- can give a suggestion on how to batch create thumbnail for MS Word docs in Windows Explorer, or
- know of the existence of some reference documentation somewhere that provides more information about this
CreateObject.("Word.Application")
and.Documents.Add()
and.Selection
and..SaveAs
- whatever, all sorts.
hope i have worded the question well enough. thanks in advance for any help.