简体   繁体   English

Word宏删除空格

[英]Word macro delete spaces

I have a macro to delete spaces between tables, which makes tables generated by a template file to join just by deleting space between them. 我有一个宏来删除表之间的空间,这使得模板文件生成的表仅通过删除它们之间的空间而可以联接。

The issue now is it is also deleting footer in the word document. 现在的问题是它也在Word文档中删除页脚。

here is my Code. 这是我的代码。

Sub AllignTables()

Dim oPara As Paragraph

For Each oPara In ActiveDocument.range.Paragraphs

        If Not oPara.range.Information(wdWithInTable) Then

            If Len(oPara.range) = 1 Then

                oPara.range.Style = "Normal"

                oPara.range.Delete

            End If

        End If

    Next oPara

End Sub

Thanks 谢谢

这可能对你有用

oPara In ActiveDocument.StoryRanges(wdMainTextStory).Paragraphs

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM