Dan's WebDAV 101

This blog covers Messaging API development for Exchange and Outlook. My name is Daniel Bagley, I'm on the Messaging Developer Team.

Browse by Tags

Tagged Content List
  • Blog Post: Howto: Example to retrieve the body property of a message using the Exchange Managed API.

    public string GetItemMime(ItemId oItemId) { string sReturn = string.Empty; PropertySet oMimePropertySet = new PropertySet(ItemSchema.MimeContent); Item oItem = Item.Bind(_ExchangeService, oItemId, oMimePropertySet); return oItem.MimeContent.ToString() ; } public string GetItemMime...
  • Blog Post: Howto: Example to retrieve the html body property of a message using the Exchange Managed API.

    public string GetMessageBodyAsHtml(Item oItem) { string sRet = string.Empty; PropertySet oPropSet = new PropertySet(PropertySet.FirstClassProperties); oItem.Load(PropertySet.FirstClassProperties); PropertySet oPropSetForBodyText = new PropertySet(PropertySet.FirstClassProperties...
  • Blog Post: Howto: Example to retrieve the body property of a message using the Exchange Managed API.

    public string GetMessageBody(Item oItem, BodyType oBodyType) { string sRet = string.Empty; PropertySet oPropSet = new PropertySet(PropertySet.FirstClassProperties); oItem.Load(PropertySet.FirstClassProperties); PropertySet oPropSetForBodyText = new PropertySet(PropertySet.FirstClassProperties...
  • Blog Post: Howto: Add a body part to a message using CDOSYS.

    The sample below shows how to add an additional body part to a message using cdosys. This example demonstrates adding a "text/calendar" (vcalendar) body part, however it should be possible to use this to add "text/plain", "text/html" and other types. In the sample, "this.VCalendarText" holds the text...
  • Blog Post: Howto: Add a body part using System.Net.Mail

    The sample below shows how to add an additional body part to a message using System.Net.Mail. This example demonstrates adding a "text/calendar" (vcalendar) body part, however it should be possible to use this to add "text/plain", "text/html" and other types. In the sample, "this.VCalendarText" holds...
  • Blog Post: Example of setting headers with System.Web.Mail

    //============================ Optional Settings ======================== if (this.Priority.Length != 0) { if (this.Priority == "Non Urgent") { oMsg.Priority = System.Web.Mail.MailPriority.Low; }; if (this.Priority == "Normal") { oMsg.Priority = System.Web.Mail.MailPriority.Normal; }; if (this.Priority...
  • Blog Post: Example of setting headers with CDOSYS

    //============================ Optional Settings ======================== if (this.Priority.Length != 0) { // Well... it seems that priority is not what needs to be set to get priority set... // Looks like setting importance will set priority... at least for cdosys... hmmm if (this.Priority == "Non...
  • Blog Post: Example of setting headers with System.Net.Mail

    Here is a partial sample on setting header fields with System.Net.Mail: //============================ Instance Message =========================== oMsg = new System.Net.Mail.MailMessage(); //============================ Optional Settings =========================== if (this.Priority.Length...
  • Blog Post: Howto Add an Attachment with Webdav

    There is no mechanism to add an attachment in WebDAV. You will need to create/recreate the item using a WebDAV PUT. The text you would be putting would be the mime of the item, which also contains the attachment. It’s useful here to use CDOSYS to create a message and add an attachment – then extract...
  • Blog Post: HOWTO: VB - Reading Delegates WebDAV Sample

    Private Sub Command1_Click() '===================================================== 'DoXML takes the href to a document 'and returns the MAPI PR_ENTRYID property expressed in 'a hexadecimal string format such as is used by CDO 1.21 'Function DoXML(strHref) Dim objX Dim objXMLdoc Dim objNode Dim strR...
  • Blog Post: Howto: VB - An example to create a public folder with storage limit settings.

    In this example, the following properties are set during the folder creation. outlookfolderclass contentclass The warning limit in KB Prohibit Post at (KB). Maximum item Size (KB) addressbookdisplayname isreadonly ishidden When reading and setting certain properties, it’s necessary to use the exchange...
  • Blog Post: HOWTO: Write a file using VBScript

    '------------------------------------------------------------------------------- ' WriteFileText - Used to write an item to a file in a folder. ' Parameters: ' sFile - The file to read ' ' Returns: ' A string containing the content of the file. '------------------------------------------------------...
  • Blog Post: Howto: VBScript - Read a file

    '----------------------------------------------------------------------------------- ' ReadFileText - Used to read a file in a folder. ' Parameters: ' sFile - The file to read ' ' Returns: ' A string containing the content of the file. '---------------------------------------------------------------...
  • Blog Post: HOWTO: Make XML returned from a propfind easier to read

    Here is a sample to reformat XML returned from WebDAV PROPFINDs to make it a little easier to read. ' ReformXML - reformats the XML to be more easily readable Private Function ReformXML(sOriginalXML) Dim sXML As String sXML = sOriginalXML sXML = Replace(sXML, "<", (vbCrLf & "<")) sXML =...
  • Blog Post: HOWTO: Send Email With Attachment Using VB and WebDAV

    To send an email with WebDAV, you will you will need to create/recreate the item with a WEBDAV PUT using the MIME of the message. It gets tricky when working with attachments. To get around the complexity of sending an email with an attachment, you may want to look at using CDOSYS to build the message...
  • Blog Post: Howto: WebDAV SEARCH using C#

    ' This example shows how to do a SEARCH using C# // C# Example to SEARCH a mailbox. // TODO: // Add a button and double click on it // Add a multi-line text box and make it big. // Add a project reference to System.Xml, an System.Net // Paste-in the code below // Do the TODO sections in the code....
  • Blog Post: Howto: WebDAV PROPFIND using VB.NET

    ' This example shows how to do a PROPFIND using VB.NET ‘ VB.NET PROPFIND ‘ TODO: Create a VB.NET winform with a button and a big multiline text box ‘ TODO: Add references to System.Web, System.XML and System.IO ‘ TODO: Add the code to the form. ‘ TODO: Do the TODO sections in the code. Imports...
  • Blog Post: Howto: WebDAV X-MS-ENUMATTS using VBScript to enumerate attachments

    ' This example shows how to enumerate attachments on a message. X-MS-ENUMATTS will ' return phantom urls to attachments on the message. These URLs can be used with GET ' and DELETE (starting with Exchange 2003 SP1). ' For listing and reading an attachment, you will first need to get a list of attachments...
  • Blog Post: Howto: WebDAV COPY using VBScript

    ' This example shows how to do a COPY of a message to a folder. 'NOTE: ' • Copying or Moving items across stores is not supported (that includes maiboxes) ' • You will get a 404 (Resource Not Found) if the source item does not exist. ' • A status of 204 (No Content) will be returned if the destination...
  • Blog Post: Howto: WebDAV MOVE using VBScript

    ' This example shows how to do a MOVE of a message to a folder. 'NOTE: ' • Copying or Moving items across stores is not supported (that includes maiboxes) ' • You will get a 404 (Resource Not Found) if the source item does not exist. ' • A status of 204 (No Content) will be returned if the destination...
  • Blog Post: Howto: WebDAV PUT using VBScript

    ' This example shows how to do a PUT of a message to a folder. What is being written with a PUT would ' be the MIME of a message and such MIME can also contain the MIME of the message. PUT works against ' messaging items directly such as mail messages. It cannot be used to add an attachment without ...
  • Blog Post: Howto: WebDAV GET using VBScript

    'The example below demonstrates how to do a WebDAV GET. ' GET works against items and attachments. When used against an item, it give you ' the mime stream of both the message and attachment. You cannot get the mime of only the message ' if there are attatchments on that message. Use X-MS-ENUMATTS to...
Page 1 of 1 (22 items)