Saving Word doc containing images, as .htm produces a folder with images in it
So we have established that saving Word doc containing images, as .htm produces a folder with images in it , and we can even find a bit of Microsoft documentation about it
As Microsoft have “wired it” to do this, we might find some useful information in the arguments Iin the Save As code line
This is the OPs original
ActiveDocument.SaveAs strPath & "" & strDocumentName, wdFormatHTML, , , , , True
In detail:
strPath & "" & strDocumentName,
wdFormatHTML,
,
,
,
,
True
Here for comparison what the macro recorder typically gave me:
ActiveDocument.SaveAs FileName:="docHTML2.htm", FileFormat:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:=False
In detail:
FileName:="docHTML2.htm",
FileFormat:=wdFormatHTML,
LockComments:= False,
Password:="",
AddToRecentFiles:= True,
WritePassword:="",
ReadOnlyRecommended:= False,
EmbedTrueTypeFonts:= False,
SaveNativePictureFormat:= False,
SaveFormsData:= False,
SaveAsAOCELetter:=False
Unnamed arguments, as used by the OP, must go in correct order. Named argumenzts, as I am using, do not have to go in order, but as far as I am aware the macro recorder does
_ give them in order, and
_ usually gives a lot of the arguments in their default values.
So we can re write the equivalent named argument version of the OPs code line thus:
FileName:= strPath & "" & strDocumentName,
FileFormat:= wdFormatHTML,
LockComments:=False,
Password:="",
AddToRecentFiles:=True,
WritePassword:="",
ReadOnlyRecommended:= True
Conclusion here is that we are more or less doiung the same thing, - a recommendation for read only likely just causes some extra warnings when the file is opened. That is of little concern to our issues
Bookmarks