Le Café Central de

                 ... Deva blogs!!

  • Le Café Central de DeVa

    Outlook Programming : How to get the File Menu commands programmatically?


    This time we will try using the Outlook Object model, we can able to get the Outlook File Menu commands programmatically (I tried with Outlook 10)

       1:          ...
       2:          ' First get the ActiveExplorer
       3:          Dim oExp As Outlook.Explorer = oApp.ActiveExplorer()
       5:          ' Then get the menu bar.
       6:          Dim oCmdBars As Office._CommandBars = oExp.CommandBars
       7:          Dim oCmdBar As Office.CommandBar = oCmdBars("Menu Bar")
       8:          'If needed display the CommandBar Name 
       9:          Console.WriteLine(oCmdBar.Name)
      11:          ' Get the controls 
      12:          Dim oBrCrls As Office.CommandBarControls = oCmdBar.Controls
      14:         ' Then get the File menu.
      15:          Dim oBPop As Office.CommandBarPopup = oBrCrls("File")
      16:         ' If needed display the caption
      17:          Console.WriteLine(oBPop.Caption)
      18:          oBrCrls = oBPop.Controls
      20:          ' Then loop each menu & display the caption
      21:          Dim oBtn As Office.CommandBarControl
      22:          For Each oBtn In oBrCrls
      23:              Console.WriteLine(oBtn.Caption)
      24:          Next
      25:          ....
  • Le Café Central de DeVa

    Office e-documents & Metadata


    Do we share metadata?

    Yes, we do, it may be knowingly or unknowingly. Take the case, that you share electronic versions of your documents (may be legal documents too). Along with that even without your knowledge you may supply more information.

    What is a Metadata:

    Whenever you create, open, or save a document in Microsoft Word, the document may store information, which is know as metadata. Even we had no intention of including or disclosing.

    What it is used for?

    Metadata is used for a variety of legitimate purposes, and it adds functionality to the editing, viewing, filing, and retrieving capabilities of Microsoft Office.

    However, if some of this information is passed on to inappropriate parties (for example, opposing counsel), that disclosure can create adverse consequences for you and your client. In order to avoid these consequences, you should make yourself familiar with the types of metadata contained in your documents and take steps to remove it whenever necessary.

    Some examples of metadata that may be stored in your documents

    Some metadata is readily accessible through the user interface of each Office program. Other metadata is only accessible through extraordinary means, such as opening a document in a low-level, binary file editor. Some examples of metadata that may be stored in your documents are,

    • Your name
    • Your initials
    • Your company or organization name
    • The name of your computer
    • The name of the network server or hard disk where you saved the document
    • Other file properties and summary information
    • Non-visible portions of embedded OLE objects
    • The names of previous document authors
    • Document revisions
    • Document versions
    • Template information
    • Hidden text or cells
    • Personalized views
    • Comments

    How we can minimize metadata in Office documents?

    We need to be careful when we share the electronic versions of the documents. Because some metadata is readily accessible through the user interface of each Office program or extraordinary means; please refer the following article which talks how we can minimize metadata in Office documents.

  • Le Café Central de DeVa

    Transport Agent Factories


    Transport agent implementation:

    Then, what is the Transport Agent factories all about...

    • The agent factory is the type that is specified when the agent is installed, and it is the only object that the transport code knows about. When transport has to create an instance of the agent, it actually calls into the CreateAgent method of the agent factory to create that instance.

    Do you wonder then where do instances of transport agents come from? Why, transport agent factories, of course! ...so, where i can get more details...  you can the above answers from this.

  • Le Café Central de DeVa

    Video : Demo of Exchange Server 2007, Windows Vista and Office 2007


    Find the enclosed demo of Exchange Server 2007, Windows Vista and Office 2007, which can give a glimpse of the products, new features etc; though it's quite older, but worth of watching this.

  • Le Café Central de DeVa

    Gotcha - PermanentURL & WebDAV Series # 1


    Take this scenario. One of my customer wanted to updated the contact fields using PR_ENTRY_ID and other fields. He can able to obtain the other all fields and getting issue with this property whenever he retrieve using WebDAV·  He gets garbage values at one client and another client it leads him to Exception.

    In this scenario, instead of using the MAPI property, we can make use of PermanentURL. In order to access the property we need to make use of the following property:

    Note: This property is unique across all servers.

    There are certain things that needs to be considered when we use the PermanentURL is listed below:

    If you use the permanenturl field, be aware of the following issues:

    . This field is the field for a permanent URL that can always be used to access an item even if the URL to the item is either renamed or moved.

    . The size of the permanenturl fields is computed according to the following conditions:

    . The flat URL name uses the following format, where the folder ID (FID) and the message ID (MID) are in long format (GUID + ID). These IDs are unique on a server.

    . For folders: http://server/virtual_root/-FlatUrlSpace-/text-format-fid-of-folder

    . For messages: http://server/virtual_root/-FlatUrlSpace-/text-format-fid-of-folder/text-format-mid-of-message

    . There must be hyphen (-) between the GUID and the ID.

    . When you change the ID to a text format, you must leave out the leading zeros. The following text is an example of a flat URL to a folder whose FID is 1-287. This example assumes that replid 1 maps to GUID 3B6D774A33B6D211AEB500C04FB6B4C6:

       1:  "/-FlatUrlSpace-/3B6D774A33B6D211AEB500C04FB6B4C6-287"   

    The following text is an example of a flat URL to a message in folder 1-287 whose MID is 1-30A:

       1:  "/-FlatUrlSpace-/3B6D774A33B6D211AEB500C04FB6B4C6-287/3B6D774A33B6D211AEB500C04FB6B4C6-30A" 

    The maximum size is:

       1:  http://long_server_name/long_virtual_root name/3B6D774A33B6D211AEB500C04FB6B4C6-FFFFFFFFFFFE/3B6D774A33B6D211AEB500C04FB6B4C6-FFFFFFFFFFFF  

    . You cannot have two permanenturl values that differ by case that point to separate items. Computer names, virtual roots, GUIDs, and hexadecimal-format FIDs and MIDs are all defined as case-insensitive.

    . To have successful queries, you may have to remove the section before "/-FlatUrlSpace-/b8d01..." in the syntax from the queries. For example, you may have to remove http://servername/folder from the following query:


    The following section includes examples of queries.

    . To test with webDAV (HTTP), run either of the following queries:

       1:  <sql> Select "http://schemas.microsoft.com/exchange/permanenturl","DAV:id 
       3:  http://schemas.microsoft.com/exchange/permanenturl" FROM Scope('SHALLOW 
       5:  TRAVERSAL OF ""') WHERE "http://schemas.microsoft.com/exchange/permanenturl" = 
       7:  /-FlatUrlSpace-/b8d014e9f474644ba656cb6adcef9d7b-1c/b8d014e9f474644ba656cb6adcef9d7b-1de6'


       1:  <sql> Select "http://schemas.microsoft.com/exchange/permanenturl","DAV:id 
       3:  http://schemas.microsoft.com/exchange/permanenturl" FROM Scope('SHALLOW 
       5:  TRAVERSAL OF ""') WHERE "http://schemas.microsoft.com/exchange/permanenturl" = 
       7:  'http://servername/folder/-FlatUrlSpace-/b8d014e9f474644ba656cb6adcef9d7b-1c/b8d014e9f474644ba656cb6adcef9d7b-1de6'  

    . To test with Microsoft ActiveX Data Objects (ADO) (the ExOLEDB file), run either of the following queries:

       1:  SELECT "http://schemas.microsoft.com/exchange/permanenturl" FROM scope('shallow traversal of 
       3:  "file://./backofficestorage/mycompany.com/MBX/user/Calendar"' 
       5:  file://./backofficestorage/mycompany.com/MBX/user/Calendar) 
       7:  WHERE "http://schemas.microsoft.com/exchange/permanenturl" = 
       9:  '/-FlatUrlSpace-/b8d014e9f474644ba656cb6adcef9d7b-1c/b8d014e9f474644ba656cb6adcef9d7b-1db5' 


       1:  SELECT "http://schemas.microsoft.com/exchange/permanenturl" FROM scope('shallow traversal of 
       3:  "file://./backofficestorage/mycompany.com/MBX/user/Calendar"' 
       5:  file://./backofficestorage/mycompany.com/MBX/user/Calendar)WHERE "http://schemas.microsoft.com/exchange/permanenturl" = 
       7:  'file://./backofficestorage/servername/folder/-FlatUrlSpace-/b8d014e9f474644ba656cb6adcef9d7b-1c/b8d014e9f474644ba656cb6adcef9d7b-1db5'  
  • Le Café Central de DeVa

    Creating Outlook rules not possible using Exchange Web Services?


    When i working with the customer who is working with Exchange Server 2007, the discussion turned towards the Exchange Web Services. He is interested to create rules on Outlook using Exchange Web Services (EWS) and looks how to proceed on this.

    At the end of research, we found that it's not possible to create rules for a specific mailbox using EWS. In the similar way, it is not possible to view the rules that are set on a mailbox with the EWS. This happens due to when we work with EWS we can't access the rules table.

    We recommended customer to make use of the following API's:

    1) using Messaging API (MAPI) with the Outlook Object Model (OOM)
    2) using Extended MAPI

    Email rules protocol specification docs - Available:

    You can find the Email rules related protocol specification documentation by clicking here.

  • Le Café Central de DeVa

    Outlook 2007 : Color category not getting printed AS-IS


    One of my customer reported that whenever he assign the color categories to his Outlook items (in Outlook 2007), he facing an unique issue. For example, if he chooses the color category - a dark color except black, whenever he took the printout it prints lighter than the other color categories; which leads him trouble to isolate it from other color. This is not a programming issue.

    This issue is fixed in the Outlook 2007 post-Service Pack 1 hotfix package that is dated September 24, 2008. It's recommended to download this package and install the hotfix as recommended.

  • Le Café Central de DeVa

    Microsoft Support Policies and Recommendations for Exchange Servers in Hardware Virtualization Environments


    As you know Hardware Virtualization software enables you to run multiple, separate operating systems concurrently on a single physical machine. Please find the Microsoft support policies enclosed here for running currently supported versions of Microsoft Exchange Server in production in a hardware Virtualization environment & recommendations for running Exchange Server in production in a hardware Virtualization environment.

    Apart from Microsoft based Hardware Virtualization, please find more details about the Microsoft support policy for third-party hardware virtualization software:

    When i was reading this article from Virtualization team, i got more input some related information. So, what's new... Thoughts on technical support..

    As of today, you'll see that we're expanding tech support policy for (initial) 31 server applications for customers that run these apps on WS08 Hyper-V, Microsoft Hyper-V Server or any other validated hypervisor (type 1 or 2). The nut of it is ... customers will be able to get the same level of tech support for virtualized workloads that they get today with non-virtualized workloads.

    The kicker here, and where many journos reported inaccurate information, is that 3rd-party vendors' hypervisors must first pass the validation test before customers can get cooperative support from Microsoft and that vendor. For example, it was reported that VMware signed an agreement to participate in the Server Virtualization Validation Program. That much is true. However, it doesn't mean that cooperative support is now in place. First, ESX Server must go through and pass the validation test. Once validated, they'll be added to KB article 944987, where we list "support partners for non-Microsoft hardware virtualization software." Today only Novell is listed, and that's due to the broader technical collaboration agreement in place between the companies.

    The other thing to note is that the server application teams have posted configurations that will be supported running on validated hypervisors. For example, the Exchange team posted a blog about their policy, which can be summarized as: 

    • Exchange Server 2007 Service Pack 1 is supported on Hyper-V and other validated hypervisors when deployed according to the guidelines published on TechNet. 
  • Le Café Central de DeVa

    Monitoring event sink # 29 - Event Sink & VSAPI


    Viruses, worms, and other malicious content transmitted by e-mail systems are a destructive reality faced by most Microsoft Exchange administrators. Therefore, we should develop a defensive antivirus deployment for all messaging systems. Now we can have a look on VSAPI.

    VSAPI is used for...

    This enables non-Microsoft vendors to implement the virus scanners or AV's, which check each message for malicious attachments and data structures before they reach their destinations.

    These features will give the antivirus products more options to delete infected messages and, with additional message properties in VSAPI 2.5, automatically send a warning message back to the sender that a virus was detected and the e-mail was deleted, thus helping prevent further spreading.

    For example you can take Exchange server 2003 and its latest versions, it will give customers more confidence in the security of their e-mail infrastructures by reducing the number of infected e-mail messages end users receive and administrators have to manage and thereby mitigating the further propagation of viruses.

    Where it's implemented?

    This event sink is implemented in OnSubmit.dll.

    Where it's registered?

    This event is registered for the OnSubmission event.

    Can you name couple of versions...

    Exchange Server 2000: Virus Scanning API (VSAPI) version 2.0 released along with Exchange Server 2000 environment. It provided improved support for scanning Internet content and reporting on the sender and receiver of the virus.

    Exchange Server 2003:

    • VSAPI 2.5 released along with Exchange Server 2003. It improves the VSAPI by allowing antivirus vendor products to run on Exchange servers that do not have resident Exchange mailboxes (for example, gateway servers or bridgehead servers).
    • Also it allows antivirus vendor products to delete an infected message and send a notification message to the sender of the infected message. The vendor products can also create additional virus status messages to allow clients to indicate the infection status of a particular message.


    1) By default, transport scanning is not enabled, as it causes messages to be scanned twice, once at the SMTP layer and once in the Exchange store

    2) Transport-scanning functionality is available only with Exchange virus scanners that are based on Virus Scanning Application Programming Interface (VSAPI) 2.5.

    Is it VSAPI vs Event sink or ...?

    VSAPI shares the same event listener and response model like any other event sink, but this special sink is implemented in the client and Transport model to check the incoming messages.

  • Le Café Central de DeVa

    Monitoring event sink # 28 - Attachments Are Missing When You Use an Event Sink to Modify the Stream of Messages


    One of my customer reported that they have a store event sink, which is used to modify the stream of incoming messages in Exchange Server environment (2003). But their attachments are missing when they open & view the message in Microsoft Outlook or in Microsoft Outlook Web Access (OWA); But contrarily when we view the message in Microsoft Outlook Express or by using Collaboration Data Objects (CDO), we can open and view the attachments in the message.

    When we investigated regarding the issue, we found that this problem occurs because messages are incorrectly processed when we use a store event sink to modify the stream of messages in Exchange Server 2003 environment. There is an hotfix available for the above issue

  • Le Café Central de DeVa

    Monitoring event sink # 27 - After you register an event sink on a mailbox store, the Microsoft Exchange Information Store service does not start in Exchange Server 2003


    One of my customer had migrated from Exchange server 2000 to Exchange Server 2003, where had an event sink registered on a mailbox store. But his Store.exe (Exchange Information Store service) stops responding for one of the following events: 

    • You restart the Microsoft Exchange Information Store service.
    • Store.exe automatically starts after a restart of the Exchange Server 2003 server, along with the event logged in the application log;

    Event Type: Error
    Event Source: Application Error
    Event Category: (100)
    Event ID: 1000
    Date: Date
    Time: Time
    User: N/A
    Computer: Computer_Name
    Description: Faulting application STORE.EXE, version Version_Number, faulting module EXOLEDB.DLL, version Version_Number, fault address 0x0002145b. For more information, see Help and Support Center at http://support.microsoft.com

    • When we troubleshooting the issue, we tried manually start the store.exe, we get the following error message:  System error has Occurred. The process terminated unexpectedly.

    When we troubleshooted the issue further we found that the issue occurs if the Criteria field in the event sink has a value of Null. To work around this problem, we tried unregister the event sink and it started working, also we recommended the customer to upgrade with the latest service pack for the Exchange Server 2003.


  • Le Café Central de DeVa

    Monitoring event sink # 26 - Implementing onTimer Event sink


    Timers & Events:

    Whenever we talk about the event sink and we plan to implement the event sink that should trigger within a specified time or interval, then we will go for onTimer Event sink.

    Basically Timers have scope, in the same way as other events. With timers, however, no event occurs in that location to cause the specified event to occur (such as a save event or a delete event).

    Note Scope does define a specific location for the registration event item, which can affect the security context of the event sink, and guarantees that the event will be deleted if the folder containing the timer event registration is deleted

    OnTimer method:

    The OnTimer method will be called after a specific interval of time. It can be called by using the IExStoreSystemEvents Interface, which is the part of EXOLEDB type library.

    This method is called for the time or time interval specified in the registration item.

    Note  The store may not invoke this sink if the server is not running when the specified time elapses. For example, if a sink registers for notification at 11:00 A.M. and the service goes down at 10:55 A.M. and comes back up at 11:05 A.M., the sink may not be called.

    Creating sample Event sink (Visual Basic):

    In order to create the Event sink with the OnTimer method, we need to make use of IEXStoreSystemEvents Interface like,

       1: Sub OnTimer(bstrURLItem As String,lFlags As LONG)
    Here, bstrURLItem - refers URL to the event registration item; lFlags - Get more information as specified in the article or refer this blog post or you can refer the EVT_INITNEW event sink flag. This flag is set at the first firing of the event. (Useful for initialization purposes. It is set only once during the lifetime of a created event sink.)

    Note The bit flags are implemented in EXEVTSNK.TLB, which is installed with the Exchange Software Development Kit (SDK), and are passed through the LFLAGS parameter of the any one of the Exchange store event interface method.

    Code Snippet(Visual Basic):

       1: 'Using OnTimer Method
       2: Private Sub IExStoreSystemEvents_OnTimer(ByVal bstrURLItem As String, ByVal lFlags As Long)
       3: ' Declare the variable
       4:     Dim FileSys         As Object
       5:     Dim eventLog      As String
       6:     Dim evtFile
       8: 'Specify the custom event log file
       9:     eventLog = Environ("SystemDrive") & "\Customlog.log"
      11: 'Creates new log file %SystemDrive%\Customlog.log or opens it if exists
      12:     Set FileSys = CreateObject("Scripting.FileSystemObject")
      13:     Set evtFile = FileSys.OpenTextFile(eventLog, 8, True)
      15: 'Now append incoming event info into log file
      16:     evtFile.WriteLine (" Event Sink logged : OnTimer()")
      17:     evtFile.WriteLine (" lFlags: " & "0x" & Hex(lFlags))
      19:     evtFile.WriteBlankLines (1)
      21: 'Clean the variables & object before we Quit
      22:     evtFile.Close
      23:     Set FileSys = Nothing
      25: End Sub

    Registering Event sink:


       1: cscript RegEvent.vbs add ontimer "Event Sink" "path" "Start time" interval -e "End time"


       1: 'Registering Event sink to execute for every one hour in between specific time duration for the specific public folder
       2: cscript RegEvent.vbs add ontimer sink1.sink1.1 file://./backofficestorage/mydomain/public%20folders/events/EventRegTimerItem1 "8/4/98 01:50:00 AM" 1 -e "8/4/98 02:50:00 AM"
Page 1 of 1 (12 items)