md文件转换成word文档_weixin_41809862的博客-CSDN博客_md转word

md文件转成word文档

Typora导出word文件时需要先下载pandoc

Typora导出word文件时因为文档里面有表格,导出失败,所以先使用使用pandoc命令导出无边框表格的word

1.在xxx.md所在文件夹打开命令提示符

2.在命令提示符输入:pandoc -s xxxx.md -o xxxx.docx ,回车后生成xxxx.docx文档。
在这里插入图片描述

3.打开word,视图-宏-查看宏-创建
在这里插入图片描述

4.输入下面代码保存,然后运行就可以全选页面所有的无边框表格,全选后在表格上右键,表格属性-边框和底纹-全部-确定。
在这里插入图片描述
Sub SelectAllTables()
Dim tempTable As Table
Application.ScreenUpdating = False
If ActiveDocument.ProtectionType = wdAllowOnlyFormFields Then
MsgBox “文档已保护,此时不能选中多个表格!”
Exit Sub
End If
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
For Each tempTable In ActiveDocument.Tables
tempTable.Range.Editors.Add wdEditorEveryone
Next
ActiveDocument.SelectAllEditableRanges wdEditorEveryone
ActiveDocument.DeleteAllEditableRanges wdEditorEveryone
Application.ScreenUpdating = True

End Sub


原网址: 访问
创建于: 2022-12-07 22:58:24
目录: default
标签: 无

请先后发表评论
  • 最新评论
  • 总共0条评论