|
楼主 |
发表于 2022-12-7 10:30
|
显示全部楼层
Sub 存为网页()
'
' 存为网页 宏
'
'
ChangeFileOpenDirectory _
"C:\Users\Administrator\Desktop\如何用代码将word另存为网页到当前文件夹内\"
ActiveDocument.SaveAs2 FileName:="如何用代码将word另存为网页到当前文件夹内.htm", FileFormat _
:=wdFormatHTML, LockComments:=False, Password:="", AddToRecentFiles:=True _
, WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False, CompatibilityMode:=0
ActiveWindow.View.Type = wdWebView
If ActiveWindow.View.SplitSpecial = wdPaneNone Then
ActiveWindow.ActivePane.View.Type = wdPrintView
Else
ActiveWindow.View.Type = wdPrintView
End If
End Sub |
|