《七年级语文教案_虞世南《蝉》诗歌鉴赏(通用14篇).docx》由会员分享,可在线阅读,更多相关《七年级语文教案_虞世南《蝉》诗歌鉴赏(通用14篇).docx(7页珍藏版)》请在taowenge.com淘文阁网|工程机械CAD图纸|机械工程制图|CAD装配图下载|SolidWorks_CaTia_CAD_UG_PROE_设计图分享下载上搜索。
1、修改:D:test为原始文件夹修改:D:test1为目标文件夹Sub Htmltodoc() Dim MyFile As String Dim Arr(10000) As String 一次处理最大的文件数量,根据需要修改数字10000改为需要处理的数量 Dim count As Integer MyFile = Dir(D:test & *.html) count = count + 1 Arr(count) = MyFile Do While MyFile MyFile = Dir If MyFile = Then Exit Do End If count = count + 1 Arr(
2、count) = MyFile 将文件的名字存在数组中 Loop For i = 1 To count Documents.Open FileName:=D:test & Arr(i), ConfirmConversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:=, PasswordTemplate:= _ , Revert:=False, WritePasswordDocument:=, WritePasswordTemplate:=, _ Format:=wdOpenFormatAuto
3、, XMLTransform:= 修改视图模式为普通模式 ActiveWindow.ActivePane.View.Type = wdPrintView 格式修改代码 Selection.WholeStory With Selection.ParagraphFormat .SpaceBeforeAuto = 0 .SpaceBefore = 0 .SpaceAfterAuto = 0 .SpaceAfter = 0 .SpaceBeforeAuto = 0 .SpaceBefore = 0 .SpaceAfterAuto = 0 .SpaceAfter = 0 .DisableLineHeig
4、htGrid = 0 .ReadingOrder = wdReadingOrderLtr .AutoAdjustRightIndent = -1 .WidowControl = -1 .KeepWithNext = 0 .KeepTogether = 0 .PageBreakBefore = 0 .FarEastLineBreakControl = -1 .WordWrap = -1 .HangingPunctuation = -1 .HalfWidthPunctuationOnTopOfLine = 0 .AddSpaceBetweenFarEastAndAlpha = -1 .AddSpa
5、ceBetweenFarEastAndDigit = -1 .BaseLineAlignment = wdBaselineAlignAuto End With Selection.Font.Name = 宋体 With Selection.Font .Size = 14 .SizeBi = 14 End With 保存为doc格式 ActiveDocument.SaveAs FileName:=D:test1 & Replace(Arr(i), .html, .doc), FileFormat:=wdFormatDocument, _ LockComments:=False, Password
6、:=, AddToRecentFiles:=True, WritePassword _ :=, ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False ActiveDocument.Close NextEnd SubHtmltodocxSub Htmltodocx() Dim MyFile As String Dim Arr(10000) As String 一次处理最大的文件
7、数量,根据需要修改数字10000改为需要处理的数量 Dim count As Integer MyFile = Dir(D:test & *.html) count = count + 1 Arr(count) = MyFile Do While MyFile MyFile = Dir If MyFile = Then Exit Do End If count = count + 1 Arr(count) = MyFile 将文件的名字存在数组中 Loop For i = 1 To count Documents.Open FileName:=D:test & Arr(i), ConfirmC
8、onversions:=False, ReadOnly:= _ False, AddToRecentFiles:=False, PasswordDocument:=, PasswordTemplate:= _ , Revert:=False, WritePasswordDocument:=, WritePasswordTemplate:=, _ Format:=wdOpenFormatAuto, XMLTransform:= 修改视图模式为普通模式 ActiveWindow.ActivePane.View.Type = wdPrintView 格式修改代码 Selection.WholeSto
9、ry With Selection.ParagraphFormat .SpaceBeforeAuto = 0 .SpaceBefore = 0 .SpaceAfterAuto = 0 .SpaceAfter = 0 .SpaceBeforeAuto = 0 .SpaceBefore = 0 .SpaceAfterAuto = 0 .SpaceAfter = 0 .DisableLineHeightGrid = 0 .ReadingOrder = wdReadingOrderLtr .AutoAdjustRightIndent = -1 .WidowControl = -1 .KeepWithN
10、ext = 0 .KeepTogether = 0 .PageBreakBefore = 0 .FarEastLineBreakControl = -1 .WordWrap = -1 .HangingPunctuation = -1 .HalfWidthPunctuationOnTopOfLine = 0 .AddSpaceBetweenFarEastAndAlpha = -1 .AddSpaceBetweenFarEastAndDigit = -1 .BaseLineAlignment = wdBaselineAlignAuto End With Selection.Font.Name =
11、宋体 With Selection.Font .Size = 14 .SizeBi = 14 End With 保存为docx格式 ActiveDocument.SaveAs FileName:=D:test1 & Replace(Arr(i), .html, .docx), FileFormat:=12, _ LockComments:=False, Password:=, AddToRecentFiles:=True, WritePassword _ :=, ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _ SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _ False ActiveDocument.Close NextEnd Sub