Although it is not recommended by Microsoft (see below), a procedure can be created in VBA (Visual Basic for Applications) and called using VBScript (Visual Basic Scripting Edition). By default, VBA is not initialised disabled when Outlook is started for performance reasons. If Outlook is started and an item opened (containing VBScript which calls a VBA procedure in the ThisOutlookSession Class Module), an error will occur as the required VBA procedure/function will not be available. For procedures to be called from the ThisOutlookSession module, security settings need to be adjusted to allow the macros to run.
Example:
Public Sub sendMessage(ByVal message As String)
MsgBox (message)
End Sub
Function Item_Close()
Set myOlApp = CreateObject("Outlook.Application")myOlApp.sendMessage("Test")
Quoted From Microsoft http://support.microsoft.com/?kbid=221827
"You cannot directly call a procedure stored in a module other than ThisOutlookSession."
"You can also use the standard Visual Basic syntax to create and call a function, and you can also pass arguments by value or by reference. You cannot directly call a procedure stored in a module other than ThisOutlookSession.
This functionality is available only as a side effect of the architecture of Outlook and the object model. It was not intended to be available as part of Outlook development environment. Because of known issues regarding this functionality, Microsoft recommends that you do not create a solution based on this functionality."
This functionality is available only as a side effect of the architecture of Outlook and the object model. It was not intended to be available as part of Outlook development environment. Because of known issues regarding this functionality, Microsoft recommends that you do not create a solution based on this functionality."
At work with outlook and other mail files I advise ti use next software-view read inbox outlook,it is reliable tool and has free status as far as I can see,also utility help you with your mailbox recovery of Microsoft Outlook, when it is corrupted or lost,can restore mail server after a failure, they will do it, otherwise, all mailboxes may be lost,keeps a replica of user's mailbox on your HDD, users usually misknow this fact, but it is very important and gives a chance to recover your data,can help you to retrieve your data from a file with *.ost extension, that is stored on your hard drive,can process files with *.ost and *.pst extensions and recover data, that was considered to be lost.
ReplyDelete