仅循环电子邮件的正文 [英] Loop though body only of an email

查看:45
本文介绍了仅循环电子邮件的正文的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想运行一个只影响当前打开的电子邮件正文的宏(例如,不影响签名).

I want to run a macro only affecting the body of the email currently open (e.g., not the signature).

如果选择了正文,则以下代码有效.不用选择怎么做?

The code below works if the body is selected. How can we do it without need for selecting?

Sub FixParagraphSpacing()

    Dim objOL As Application
    Dim sel As Object

    Set objOL = Application
    Set sel = objOL.ActiveInspector().WordEditor.Application.Selection

    For Each para In sel.Paragraphs
        para.SpaceBefore = 0.3 * 11
        para.SpaceAfter = 0
    Next para

End Sub

推荐答案

这里是解决方案

Sub FixParagraphSpacing()
     Dim objOL As Application
     Dim doc As Object
     Dim para As Object

     Set objOL = Application
     Set doc = objOL.ActiveInspector().WordEditor

     For Each para In doc.Paragraphs
         para.SpaceBefore = 0.3 * 11
         para.SpaceAfter = 0
     Next para
 End Sub

这篇关于仅循环电子邮件的正文的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆