VBA代码从Outlook Adin中选择值 [英] VBA Code to select value from Outlook Adin

查看:107
本文介绍了VBA代码从Outlook Adin中选择值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友们,


我有以下VBA从outlook发送邮件但是我无法弄清楚会选择"分类:限制"的代码片段(这个加入是由客户开发的,加入称为IC labeeling addin并添加到outlook Ribbon)。


可以请一些人帮我查看代码,从中选择值outlook Ribbon?


                


Sub CreateMail()

    Dim rng As Range

    rowN = ThisWorkbook.Sheets(" Impact Analysis")。Cells(Rows.Count,7).End(xlUp).Row

   设置rng = ThisWorkbook.Sheets(" Impact Analysis")。范围("C6:G"& rowN)

    Dim OutApp

   设置OutApp = CreateObject(" Outlook.Application")

   设置OutMail = OutApp.CreateItem(0)

   随着OutMail

        .To =" karthickonmail@gmail.com"

        '.CC =""

        '.BCC =""

        .Subject ="表格更改影响请查看。"


        .HTMLBody ="对表格进行了以下更改,请执行回归测试" &安培; vbCrLf& RangetoHTML(rng)_

        &安培; vbCrLf& "更改原因:"


        。发送¥b $ b   结束


提前致谢。


解决方案

如何添加标签消息吗?尝试使用
OutlookSpy
(单击IMessage按钮)查看消息,以检查设置了哪些属性。

Hi Friends,

I have the below VBA to send mail from outlook but I am unable to figure out the piece of code that would select the 'classification: Restricted' (This add in was developed by client and the add in called as IC labeeling addin and added to outlook Ribbon).

Can some one please help me with the code, to select the value from outlook Ribbon?

                

Sub CreateMail()
    Dim rng As Range
    rowN = ThisWorkbook.Sheets("Impact Analysis").Cells(Rows.Count, 7).End(xlUp).Row
    Set rng = ThisWorkbook.Sheets("Impact Analysis").Range("C6:G" & rowN)
    Dim OutApp
    Set OutApp = CreateObject("Outlook.Application")
    Set OutMail = OutApp.CreateItem(0)
    With OutMail
        .To = "karthickonmail@gmail.com"
        '.CC = ""
        '.BCC = ""
        .Subject = "Table change impact please review."

        .HTMLBody = "The below changes has been made to the tables,please perform the regression testing" & vbCrLf & RangetoHTML(rng) _
        & vbCrLf & "Reason for Change:"

        .Send
    End With

Thanks in Advance.

解决方案

How does the addin label messages? Try to look at the message with OutlookSpy (click IMessage button) to check which properties are set.


这篇关于VBA代码从Outlook Adin中选择值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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