Reputation: 595
I've got a macro in Excel that send e-mail through Outlook and it works perfectly. But in my company they recently added an e-mail classification. Can I insert on my code?
Example: If send 2.000 e-mails at once, I'll have to click 2.000 times on any of the classification button.
The language is in Portuguese (Brazil), so by order is: Confidential, Reserved, Internal, Public.
Classification:
Sub ContatoAtivo()
Application.ScreenUpdating = False
Application.DisplayAlerts = False
Dim OutlookApp As Object
Dim OutlookMail As Object
Dim xTexto As String
Dim Texto As String
Dim X, Y, Z As Integer
Dim Email As String
Dim Assunto As String
Dim Qtd As Integer
Dim rng As Range
Qtd = Planilha2.ListObjects(1).DataBodyRange.Rows.Count
For X = 1 To 1
Email = Planilha2.Cells(X + 6, 8).Value
Subject = Planilha3.Cells(11, 1).Value
If Email <> "" Then
Set rng = Nothing
Set rng = Planilha3.Range("E12:F22").SpecialCells(xlCellTypeVisible)
Set OutlookApp = CreateObject("Outlook.Application")
Set OutlookMail = OutlookApp.CreateItem(0)
Text = "Test"
With OutlookMail
.To = "test.test@test.com.br"
.CC = ""
.BCC = ""
.Subject = Planilha3.Range("A5").Value & " | " & Subject
.HTMLBody = Text
'.Display
.Send
End With
Set OutlookMail = Nothing
Set OutlookApp = Nothing
Texto = ""
End If
Next X
Application.DisplayAlerts = True
Application.ScreenUpdating = True
End Sub
Thanks!
Upvotes: 0
Views: 2813
Reputation: 49455
These controls belong to the Azure Information Protection add-in. Unfortunately, Office (nor VBA or VSTO) doesn't provide any trivial way for customizing a custom UI or dealing with it. Your options are listed below:
idMso
parameter. You must find the ID of controls you need to launch programmatically.Anyway, I'd suggest contacting AIP add-in developers.
Upvotes: 3