Option Explicit
Private Sub highest_folder()
Dim obj As Object
Dim F As Folder
Dim nextF As Folder
Set obj = ActiveWindow
If TypeOf obj Is Inspector Then
Set obj = obj.currentItem
Else
Set obj = obj.Selection(1)
End If
Set F = obj.Parent...
How to add a shared mailbox as additional account in Outlook
Reminders for an added shared account pop up as though they were my own appointments.
I tested and the reminder triggers the code and mail is deferred to Item.End
Runtime Error 91 - Object variable not set.
With the assumption that the error occurs on the line objNewMailItems_ItemAdd ActiveInspector.CurrentItem the object is an open mailitem "ActiveInspector.CurrentItem ". Did you open a mailitem?
Whether in Excel or Outlook you cannot run code that requires a parameter as standalone.
You can drag a mailitem into the folder or add a mailitem to the folder with other VBA code
or for testing, except for the adding part, you can pass a mailitem like this:
Private Sub test()
' First open a...
There is no code fix that I can see. The code works in a profile where I added an account Add an email account to Outlook . The code generates an error in a profile where I added a mailbox How to Add Additional Mailbox to Outlook 2016
On Error Resume Next = Fail mysteriously when I do not know how to use it.
If you remove the two instances of On Error Resume Next when you run the code on the Inbox you will see any errors that were being hidden. Once fixed you would run the code on the shared mailbox and see any different...
ItemChange will run on the one item that triggers it unless you code it to process other items. Without code it is impossible to determine the issue.
You do not have to "suspect it is running the macro in a loop on all items." To debug put a breakpoint in the code and step through with F8.
You can extract somewhat useful information out of SenderEmailAddress.
Public Sub SaveAttachmentsToDisk(MItem As mailItem)
Dim oAttachment As attachment
Dim sSaveFolder As String
Dim sndrEmailAdd As String
Dim sndrEmailRight As String
Dim sndrEmailPreDot As String...
You could set all the categories at once:
Private Sub SetCategories()
Dim myItem As Object
Dim strCat As String
Set myItem = ActiveInspector.currentItem
If myItem.Class = olMail Then
strCat = "Estimate, client, someone waiting, Now"
myItem.Categories = strCat
myItem.Save
End If...
You forgot the subject.
If Left(aItem.subject, 8) = Left(aItem.ReceivedTime, 8) Then GoTo Skip
To remove duplicate prefixes:
Option Explicit
Sub PrefixReceivedTime_RemoveDuplicate()
Dim aItem As Object
Dim aMail As mailItem
Dim aSubject As String
Dim mailFldr As folder...
Assuming your text is now on a single line, after you make a backup you can try replacing the 0A0D in the text.
Private Sub ContactFolderItems_replace_0A0D()
Dim cFolder As folder
Dim cItem As Object
Dim i As Long
' 0A = Line feed
' 0D = Carriage return
Set cFolder =...
You can filter the recipients by type
For Each recip In item.Recipients
If Not recip.Type = olBCC Then
If Not recip = "xxx@domain.com" + "yyy@domain.com" Then
newMsg.Recipients.Add recip
End If...
The originator of the mail could use a template where Reply is disabled.
Follow these instructions for the Reply button. Disable “Reply to All” For Email Recipients
If Reply is needed then the receiver can delete the entry in To and enter specific addresses.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.