+ Reply to Thread
Results 1 to 2 of 2

excel macro to create outlook message - with Private sensitivity

Hybrid View

aarona excel macro to create outlook... 03-18-2017, 02:17 AM
aarona Re: excel macro to create... 03-18-2017, 02:22 AM
  1. #1
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    excel macro to create outlook message - with Private sensitivity

    Hi All,

    I have this code that will automatically create an email template from excel.

    I'm having trouble with the settings. I want the message to automatically set to Sensitivity = Private.

    Dim Sheet1 As Worksheet
    Dim Sheet2 As Worksheet
    
    Dim olLook As Object 'Start MS Outlook
        Dim olNewEmail As Object 'New email in Outlook
        Dim strContactEmail As String 'Contact email address
        Dim Overall As Range
        
        Set olLook = CreateObject("Outlook.Application")
        Set olNewEmail = olLook.CreateItemFromTemplate("P:\Email Template - Aaron\Untitled.oft")
    
    Set Sheet1 = Worksheets("Sheet1")
    Set Sheet2 = Worksheets("Sheet2")
    DistributionFigure = Sheet2.Range("B11").Value
    LoanAmountPrincipal = Sheet2.Range("B14").Value
    Difference = Sheet2.Range("B16").Value
    
    DistributionFigure = Format(Sheet2.Range("B11"), "Currency")
    LoanAmountPrincipal = Format(Sheet2.Range("B14"), "Currency")
    Difference = Format(Sheet2.Range("B16"), "Currency")
    
    
      'strEmailSubject = Range("M9") & Range("D11") & " " & UCase(Range("D12"))
        strEmailText = ""
            'strContactEmail = NAME@DOMAIN
    
            With olNewEmail 'Attach template
            .to = ""
            .CC = ""
            .htmlBody = Msg & Sheet2.Range("B2").Value & " " & "<b>" & Sheet2.Range("B3").Value & "</b>" & _
            "<br><br>" & "<b><u>" & Sheet2.Range("B6").Value & "</b></u>" & _
            "<br><br>" & Sheet2.Range("B8").Value & "<b>" & Sheet2.Range("B9").Value & "</b>" & _
            Sheet2.Range("B10").Value & "<b>" & DistributionFigure & "</b>" & Sheet2.Range("B12").Value & _
            "<b>" & Sheet2.Range("B9").Value & "</b>" & Sheet2.Range("B13").Value & "<b>" & LoanAmountPrincipal & "</b>" & _
            Sheet2.Range("B15").Value & "<b>" & Difference & "</b>" & Sheet2.Range("B17").Value & "<br><br>" & _
            Sheet2.Range("B36").Value & "<br><br>" & _
            "<b>" & Sheet2.Range("B18").Value & "</b><br><br>" & "&emsp;" & Sheet2.Range("B19").Value & _
            "<u>" & Sheet2.Range("B20").Value & "</u>" & Sheet2.Range("B21").Value & "<b>" & Difference & "</b>" & Sheet2.Range("B22").Value & _
            "<br><br>&emsp;" & Sheet2.Range("B23").Value & "<br><br>" & _
            "&emsp;&emsp;" & Sheet2.Range("B24").Value & "<br>&emsp;&emsp;" & Sheet2.Range("B25").Value & _
            "<br>&emsp;&emsp;" & Sheet2.Range("B26").Value & "<br><br>&emsp;&emsp;" & Sheet2.Range("B27").Value & "<br><br>" & _
            Sheet2.Range("B28").Value & "<u>" & Sheet2.Range("B29").Value & "</u>" & Sheet2.Range("B30").Value & _
            "<b>" & Difference & "</b>" & Sheet2.Range("B31").Value & "<br><br>" & Sheet2.Range("B32").Value & _
            "<br><br>" & Sheet2.Range("B33").Value
            
            .Subject = Sheet2.Range("A6").Value
            '.attachments.Add Range("O2").Value
            .display
            End With
    As for the workbook, I cant upload it since it's confidential.

    Any help will do. Thanks in advance.

  2. #2
    Forum Contributor
    Join Date
    06-07-2016
    Location
    Manila
    MS-Off Ver
    365
    Posts
    292

    Re: excel macro to create outlook message - with Private sensitivity

    well nevermind, was able to solve it - .Sensitivity = 2

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Outlook 2013 - Create New Task for this message
    By hobbiton73 in forum Outlook Formatting & Functions
    Replies: 0
    Last Post: 10-21-2014, 04:04 AM
  2. Problem with Excel Macro to save new open Outlook message into PDF
    By Konradi in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 08-05-2014, 04:43 AM
  3. [SOLVED] Create New Message in Outlook, Don't Send
    By athyeh in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 03-20-2014, 10:33 AM
  4. Create Outlook Reminder on Excel and transfered to outlook by macro
    By Benjamin2008 in forum Excel Programming / VBA / Macros
    Replies: 2
    Last Post: 09-21-2013, 03:23 PM
  5. Create Outlook task from Excel Macro?
    By Jay Harris in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 08-04-2013, 11:11 PM
  6. Macro to export outlook message body to excel
    By VKS in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 07-08-2013, 08:02 AM
  7. Accessing an outlook message via an excel macro
    By jeskit in forum Excel Programming / VBA / Macros
    Replies: 4
    Last Post: 06-10-2011, 06:38 AM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1