Consulting

Results 1 to 4 of 4

Thread: Create Add-in?

  1. #1
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    4
    Location

    Create Add-in?

    I created a macro project, just curious if there is a way to create an add-in that a user can double click and have it install on their outlook?

  2. #2

  3. #3
    VBAX Newbie
    Joined
    Feb 2017
    Posts
    4
    Location
    I actually opened up Visual Studio and opened a project for office outlook add-in.

    Is there an easy way to convert this macro to vb?

    Option Explicit
     
    Sub prefixSubjectWithEncrypt()
         
        Dim myItem As MailItem
        Set myItem = ActiveInspector.CurrentItem
    
        myItem.Display
        
        If myItem.To = "" Then
        MsgBox "You need at least one recipient"
        Exit Sub
        End If
        
        myItem.Subject = "[encrypt]" & myItem.Subject
        myItem.Send
        
    End Sub
    and assign it a button?

  4. #4
    VBAX Expert Logit's Avatar
    Joined
    Sep 2016
    Posts
    613
    Location
    Each of the email fields can be hard coded or reference a cell value:

    With OutMail
      .To = Sheets("Sheet1").Range("A1").Value_________ 'or it could be hardcoded like  .To = "an_email@anywhere.com"
      .Subject = "Testfile"____________________________ 'or Sheets("Sheet1").Range("B1").Value
      .Body = "Hi "__________________________________' or Sheets("Sheet1").Range("C1").Value
      .Send  'Or use .Display
    End With
    Then, to check for any empty fields:

    If .To = "" Then
         MsgBox "You need at least one recipient in the TO field"
         Exit Sub
    End If
    
    If .Subject = "" Then 
         etc., etc.,

    The above is the basics ... here is an example email project (attached):WORKS Mail It.xlsm

Posting Permissions

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