Tắt bỏ thông báo Send message without a subject trong Outlook 2010

  1. Tác giả: LTTK CTV03
    Đánh giá: ✪ ✪ ✪ ✪ ✪

    Trong bài hướng dẫn dưới đây, chúng tôi sẽ giới thiệu các bạn cách tắt bảng thông báo “Do you want to send thí message without a subject” của Microsoft Outlook 2010. Trước tiên, mở chương trình Outlook, nhấn Alt + F11 để mở cửa sổ Microsoft Visual Basic:

    [​IMG]

    Sau đó, kích đúp vào phần ThisOutlookSession như hình dưới:

    [​IMG]

    Và điền đoạn mã sau đây:
    Mã (Text):
    1. Option Explicit
    2.  
    3. '=========================================================================
    4. ' Prevents Outlook® 2010 to display a no-subject warning message
    5. ' (c) Peter Marchert - http://www.outlook-stuff.com
    6. ' 2010-07-15 Version 1.0.0
    7. ' 2010-07-19 Version 1.0.1
    8. '=========================================================================
    9.  
    10. Private WithEvents colInspectors As Outlook.Inspectors
    11.  
    12. Private Sub Application_Startup()
    13.  
    14. '---------------------------------------------------------------------
    15. ' Set a reference to all forms
    16. '---------------------------------------------------------------------
    17. Set colInspectors = Outlook.Inspectors
    18.  
    19. End Sub
    20.  
    21. Private Sub colInspectors_NewInspector(ByVal Inspector As Inspector)
    22.  
    23. '---------------------------------------------------------------------
    24. ' This code is running if a form (e. g. an e-mail) will be opened
    25. '---------------------------------------------------------------------
    26.  
    27. Dim objItem As Object
    28.  
    29. '---------------------------------------------------------------------
    30. ' Skip errors
    31. '---------------------------------------------------------------------
    32. On Error GoTo ExitProc
    33.  
    34. '---------------------------------------------------------------------
    35. ' Set a reference to the open item
    36. '---------------------------------------------------------------------
    37. Set objItem = Inspector.CurrentItem
    38.  
    39. '---------------------------------------------------------------------
    40. ' A new item does not have a received time
    41. '---------------------------------------------------------------------
    42. If Year(objItem.ReceivedTime) = 4501 Then
    43.  
    44. '-----------------------------------------------------------------
    45. ' Check if the subject is empty if an e-mail was created by a
    46. ' template with predefined subject.
    47. '-----------------------------------------------------------------
    48. If objItem.Subject = "" Then objItem.Subject = " "
    49. End If
    50. ExitProc:
    51.  
    52. '---------------------------------------------------------------------
    53. ' Delete the reference to the form and to the item
    54. '---------------------------------------------------------------------
    55. Set objItem = Nothing
    56. Set Inspector = Nothing
    57.  
    58. End Sub
    59.  
    60. Private Sub Application_ItemSend(ByVal Item As Object, Cancel As Boolean)
    61.  
    62. On Error Resume Next
    63.  
    64. '---------------------------------------------------------------------
    65. ' If the blank still exists it will now be removed (Outlook®
    66. ' will this not recognize)
    67. '---------------------------------------------------------------------
    68. Item.Subject = Trim(Item.Subject)
    69.  
    70. End Sub
    71.  
    72. Private Sub Application_Quit()
    73.  
    74. '---------------------------------------------------------------------
    75. ' Delete the reference to the forms
    76. '---------------------------------------------------------------------
    77. Set colInspectors = Nothing
    78. End Sub
    Lưu Session, khởi động lại Outlook và từ lần sau trở đi, nếu bạn gửi email không có phần tiêu đề – Subject thì chương trình sẽ không hiển thị thông báo như trước nữa. Lưu ý 1 điều rằng chúng ta phải kích hoạt chế độ hoạt động của Macro trong phần Trust Center của Outlook. Chúc các bạn thành công!