网站大量收购闲置独家精品文档,联系QQ:2885784924

如何把WORD批量转换为TXT格式.doc

  1. 1、本文档共2页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
如何把WO?RD文档批?量转换为T?XT格式 按Alt+F8,打开宏对话?框,然后随便新?建一个宏,单击创建,打开宏代码?编辑器,然后将编辑?器中的所有?内容清空,将如下代码?直接粘贴后?,然后将光标?置于Sub? BatDo?cToTx?t()之后,按F5运行?即可。 ====代码开始==== Publi?c Decla?re Funct?ion SHBro?wseFo?rFold?er Lib shell?32.dll Alias? SHBro?wseFo?rFold?erA (lpBro?wseIn?fo As Folde?rInfo?r) As Long Publi?c Decla?re Funct?ion SHGet?PathF?romID?List Lib shell?32.dll Alias? SHGet?PathF?romID?ListA? (ByVal? pidl As Long, ByVal? pszPa?th As Strin?g) As Long Publi?c Type Folde?rInfo?r hOwne?r As Long pidlR?oot As Long pszDi?splay?Name As Strin?g lpszT?itle As Strin?g ulFla?gs As Long lpfn As Long lPara?m As Long iImag?e As Long End Type Publi?c Funct?ion BrowD?ir() As Strin?g Dim iFold?er As Folde?rInfo?r Dim pidl As Long, Flag As Long, iPath? As Strin?g, Pos As Integ?er pidl = SHBro?wseFo?rFold?er(iFold?er) iPath? = Space?$(512) Flag = SHGet?PathF?romID?List(ByVal? pidl, ByVal? iPath?) If Flag Then Pos = InStr?(iPath?, Chr$(0)) BrowD?ir = Left(iPath?, Pos - 1) End If End Funct?ion Sub BatDo?cToTx?t() Dim InPat?h As Strin?g, Filen?ame As Strin?g, OutPa?th As Strin?g rc = MsgBo?x(本功能为将?指定文件夹?中的所有d?oc文档转?换为txt?文件。 + vbCrL?f + 已准备就绪?可继续?, vbInf?ormat?ion + vbYes?No + vbDef?aultB?utton?2, 消息) If rc = vbNo Then Exit Sub MsgBo?x 请指定待处?理的文档所?在的目录。, vbInf?ormat?ion, 消息 InPat?h = BrowD?ir If InPat?h = Then Exit Sub MsgBo?x 请指定待转?换后的tx?t文件的输?出目录。 + vbCrL?f + 默认为待处?理的目录。, vbInf?ormat?ion, 消息 OutPa?th = BrowD?ir If OutPa?th = Then OutPa?th = InPat?h MsgBo?x 即将进行转?换,并未死机,请耐心等候?完成通知!, vbInf?ormat?ion, 消息 Appli?catio?n.Visib?le = False? Appli?catio?n.Displ?ayAle?rts = wdAle?rtsNo?ne Filen?ame = Dir(InPat?h \*.doc) Do Until? Filen?ame = On Error? Resum?e Next Docum?ents.Open InPat?h \ Filen?ame If Err.Numbe?r = 0 Then Activ?eDocu?ment.SaveA?s OutPa?th \ Left(Filen?ame, Len(Filen?ame) - 3) txt, 2 On Error? Resum?e Next Activ?eDocu?ment.Close? Filen?ame = Dir() Lo

文档评论(0)

ligennv1314 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档