• Introduction - Who Should Use This Book
  • Chapter 1 - Applications You Can Create with Outlook
  • Types of Applications You Can Create
  • Forms You Can Create
  • Folder Applications
  • Chapter 2 - Outlook Design Tools
  • Help and Web Sites
  • Outlook Form Design Mode
  • Outlook Visual Basic for Applications Design Tools
  • Other Tools and Add-Ins
  • Chapter 3 - Customize Built-In Modules
  • Overview of the Folder You Create
  • Create New Folders
  • Create Custom Views
  • Create Items for the Beta Contacts Folder
  • Enter Dates in the Beta Participants View
  • Customize the Contacts Form
  • Test the Form at Design Time
  • Publish the Form
  • Specify the Default Form for the Folder
  • Test the Application
  • Delete the Items You Created
  • Copy the Folder to Public Folders
  • Set Permissions
  • Release the Application
  • Chapter 4 - Design a Custom Application
  • Overview of the Product Ideas Application
  • Create the Product Ideas Folder
  • Create the Product Idea Form
  • Create the Product Idea Response Form
  • Set the Actions
  • Create the Product Category View
  • Specify the Default Form for the Folder
  • Set the Hidden Property for the Product Idea Response Form
  • Test the Application
  • Copy the Folder to Public Folders
  • About Folder Permissions
  • Release the Application
  • Chapter 5 - Forms
  • Become Familiar with Designing Forms and Form Components
  • Fields
  • Learn How Forms Work
  • Create a Folder
  • Open the Form and Switch to Design Mode
  • Edit Form Pages
  • Add Controls
  • Create and Bind Fields
  • Polish the Layout
  • Create Help (Optional)
  • Edit the Read Page
  • Set Action Properties
  • Set Form Properties
  • Publish the Form
  • Test and Release the Form
  • Where To Go from Here
  • Chapter 6 - Controls, Fields, and Properties
  • Set Control Display Properties
  • Layer Controls
  • Set Advanced Control Properties
  • Bind a Control to an Existing Field
  • Create User-Defined Fields
  • Set Initial Field Values
  • Validate and Restrict Data
  • Set Field-Specific Properties
  • About the Control Toolbox
  • Set Control-Specific Properties
  • Image Controls
  • Where to Go from Here
  • Chapter 7 - Actions
  • Voting Buttons for Message Forms
  • Reply Actions for Message Forms
  • Reply To Folder Actions for Post Forms
  • Where To Go from Here
  • Chapter 8 - Folders
  • An Important Reminder About Planning
  • Create or Select a Folder
  • Publish Forms in the Folder
  • Design Folder Views
  • Use Folder Home Pages
  • Set General Properties
  • Test Forms and Views
  • Copy the Folder to Public Folders
  • Specify Internet Newsgroup
  • Set Administration Properties
  • Set Permissions
  • Design Rules
  • Make the Folder Available for Offline Use
  • Test and Release the Folder
  • Where To Go from Here
  • Chapter 9 - Raise Events and Move to the Head of the Class
  • The VBA Editor
  • Writing an Outlook Macro
  • Writing Code to Respond to Events
  • Application Events
  • Reminders Collection Events
  • NameSpace Events
  • Explorers Collection Events
  • Explorer Events
  • SyncObject Events
  • OutlookBarPane Events
  • OutlookBarGroup Events
  • OutlookBarShortcut Events
  • Inspectors Collection Events
  • Inspector Events
  • Folders Collection Events
  • Views Collection Events
  • Items Collection Events
  • Item Events
  • Firing Order of Events
  • Where To Go from Here
  • Chapter 10 - The Outlook Development Environment
  • The Outlook E-Mail Security Update
  • Trusted COM Add-Ins
  • Outlook and VBA
  • VBScript Versions
  • The Outlook Script Editor
  • Troubleshooting Code Using the Microsoft Script Editor
  • How To Open an Item Containing VBScript
  • Information Resources for Programming Outlook 2002
  • Object Libraries
  • Object Models
  • Where To Go from Here
  • Chapter 11 - Using Visual Basic, VBA, or VBScript with Outlook
  • The Application Object
  • The NameSpace Object
  • The Outlook Window (Explorer Objects)
  • The Panes Collection Object
  • The OutlookBarStorage Object
  • The OutlookBarGroups Collection Object
  • The OutlookBarShortcuts Collection Object
  • The CommandBars Collection Object
  • The CommandBarControls Collection Object
  • The AddressLists Collection Object
  • The AddressList Object
  • The AddressEntries Collection Object
  • The AddressEntry Object
  • The Folders Collection Object
  • The MAPIFolder Object
  • The Views Collection Object
  • The Items Collection Object
  • The PostItem Object
  • The MailItem Object
  • The DocumentItem Object
  • The AppointmentItem Object
  • The MeetingItem Object
  • The TaskItem Object
  • The TaskRequestItem Object
  • The ContactItem and DistListItem Objects
  • The JournalItem Object
  • The Item Window (Inspector Objects)
  • The Pages Collection Object
  • The Page Object
  • The Controls Collection Object
  • The Control Object
  • The UserProperties Collection Object
  • The ItemProperties Collection Object
  • The Recipients Collection Objec
  • Automation
  • Where To Go from Here
  • Chapter 12 - The Northwind Contact Management Application
  • Overview
  • Setting Up the Application
  • Loading the Company and Company Contact Forms
  • The Company Form
  • Other Application Forms
  • The Outlook Shared Activities Add-In
  • Application Folder Views
  • Releasing the Northwind Contact Management Application
  • Customizing the Application
  • Where To Go from Here
  • Chapter 13 - Distributing and Securing Applications
  • Distribute Forms
  • Manage Forms
  • Modify Forms
  • The Forms Cache
  • Form Activation
  • Distribute and Manage Folders
  • Outlook 2002 Security
  • CDO Security
  • Administrative Options
  • The Outlook Security Form
  • Creating Custom Security Settings
  • Where To Go from Here
  • Chapter 14 - Creating COM Add-Ins with Visual Basic
  • Tools Needed to Create COM Add-Ins
  • The COMAddIns Collection Object
  • COMAddIn Object
  • Displaying the List of COM Add-Ins
  • Creating an Outlook COM Add-In Project in Visual Basic
  • What Is a COM Add-In?
  • Building a COM Add-In
  • Adding Property Pages
  • Modifying Command Bars
  • Adding Dialog Boxes
  • The Debugging Process
  • Compiling Your COM Add-In
  • Sample COM Add-Ins
  • Add-In Registration
  • Providing Security
  • Deploying Your COM Add-In
  • Where To Go from Here
  • Chapter 15 - Integrating Outlook with Web Applications
  • What Folder Home Pages Are
  • What Folder Home Pages Are Not
  • Folder Home Page Security
  • The Outlook Today Page
  • Tools to Create Folder Home Pages
  • The Outlook View Control
  • Digital Dashboards
  • Creating My Dashboard
  • Designing Web Parts with Office XP Developer
  • The Northwind Digital Dashboard
  • Communicating Between Web Parts
  • Putting It All Together
  • Where to Go from Here
  • Chapter 16 - Using Outlook with SharePoint Portal Server
  • SharePoint Portal Server Evaluation Edition
  • SharePoint Portal Server Platform
  • Document Management
  • Content Indexing and Searches
  • The Power of Subscription
  • Outlook Integration with SharePoint Portal Server
  • The Outlook Shared Activities Add-In
  • The PKMCDO Object Model
  • An Outlook COM Add-In for SharePoint Portal Server
  • SharePoint Development Opportunities
  • Where to Go from Here
  • Author Bio
  • Tell Us What You Think
  • Full-Text Search
  • Use Full-Text Search
  • Advanced Full-Text Search
  • Search for Information
  • Find Information with Advanced Full-Text Search
  • Search for Words or Phrases
  • Define Search Terms
  • Use Nested Expressions
  • Search for Words in the Titles of Topic Files
  • Find Words Similar to Your Search Term
  • Create a List of Favorite Topics
  • Search Previous Results
  • eBooks_common_files21.shtmll
  • External Links
  • Enlarge Graphics
  • Use Accessibility Shortcut Keys
  • Use the Shortcut Menu Commands
  • To Turn On MouseKeys
  • Customize the Help Viewer
  • Print the Current Topic
  • C ++
  • The PKMCDO Object Model

    An extensive discussion of the PKMCDO Object Model is beyond the scope of this book. Instead, I’ll cover some of the most important objects in the PKMCDO Object Model to give you a basic understanding of what PKMCDO can do. The PKMCDO Object Model allows you to accomplish programmatically many of the tasks that you would perform in the Web folders user interface. At the top of the PKMCDO Object Model is the KnowledgeServer object. To help you understand the dependencies in the PKMCDO Object Model, the EnumerateWorkspaces procedure displays workspaces, folders, and documents in the Debug window. Here is the code for the procedure:

    Sub EnumerateWorkspaces()
    Dim oServer As New PKMCDO.KnowledgeServer
    Dim oWS As New PKMCDO.KnowledgeWorkspace
    Dim oFolder As New PKMCDO.KnowledgeFolder
    Dim oCategory As New PKMCDO.KnowledgeCategoryFolder
    Dim oDocument As New PKMCDO.KnowledgeDocument
    Dim oVersion As New PKMCDO.KnowledgeVersion
    Dim oContentClass As New PKMCDO.KnowledgeContentClass
    Dim rsWorkspaces, rsFolders, rsCategories As ADODB.Recordset
    Dim rsDocuments, rsVersions As ADODB.Recordset
    Dim strServerURL, strWorkspaceURL As String
    Dim strFolderURL, strDocumentURL As String
    
    On Error Resume Next
    strServerURL = InputBox _
       ("Enter the URL for SharePoint Portal Server (http://<servername>):", _
       "Enumerate Workspaces")
    If strServerURL = "" Then
        Exit Sub
    End If
    If Right(strServerURL, 1) = "/" Then
        strServerURL = Left(strServerURL, Len(strServerURL) - 1)
    End If
    oServer.DataSource.Open strServerURL & "/Public/Workspaces"
    Debug.Print "Server Creation Date: " & oServer.CreationDate & " GMT"
    Debug.Print "SMTP Server: " & oServer.SMTPServerName
    Debug.Print "Workspaces on : " & strServerURL
    Set rsWorkspaces = oServer.Workspaces
    While Not rsWorkspaces.EOF
        strWorkspaceURL = rsWorkspaces.Fields(PKMCDO.cdostrURI_HREF)
        strWorkspaceURL = strServerURL & "/" _
           & Right(strWorkspaceURL, _
           Len(strWorkspaceURL) - InStrRev(strWorkspaceURL, "/"))
        Debug.Print rsWorkspaces.Fields(PKMCDO.cdostrURI_DisplayName)
        Debug.Print Chr(9) & "(" & _
           rsWorkspaces.Fields(PKMCDO.cdostrURI_Description) & ")"
        Debug.Print Chr(9) & strWorkspaceURL
        ‘Open the workspace
        oWS.DataSource.Open strWorkspaceURL
        Set rsFolders = oWS.Subfolders
        Debug.Print Chr(9) & Chr(9) & "Folders:"
        While Not rsFolders.EOF
            strFolderURL = rsFolders.Fields("DAV:href")
            Debug.Print Chr(9) & Chr(9) _
               & rsFolders.Fields(PKMCDO.cdostrURI_DisplayName)
            Debug.Print Chr(9) & Chr(9) & strFolderURL
            If rsFolders.Fields("DAV:contentclass") = _
               "urn:content-classes:rootcategoryfolder" Then
                oCategory.DataSource.Open strFolderURL
                Debug.Print Chr(9) & Chr(9); "Category: " & oCategory.DisplayName
                Set rsCategories = oCategory.Subfolders
                While Not rsCategories.EOF
                    Debug.Print Chr(9) & Chr(9) & Chr(9) _
                       & rsCategories.Fields(PKMCDO.cdostrURI_DisplayName)
                    Debug.Print Chr(9) & Chr(9) & Chr(9) _
                       & rsCategories.Fields("DAV:href")
                    rsCategories.MoveNext
                Wend
            End If
            oFolder.DataSource.Open strFolderURL
            Debug.Print Chr(9) & Chr(9) & Chr(9) & "Items:"
            Set rsDocuments = oFolder.Items
            While Not rsDocuments.EOF
                strDocumentURL = rsDocuments.Fields("DAV:href")
                Debug.Print Chr(9) & Chr(9) & Chr(9) _
                   & rsDocuments.Fields(PKMCDO.cdostrURI_DisplayName)
                Debug.Print Chr(9) & Chr(9) & Chr(9) _
                   & strDocumentURL
                oDocument.DataSource.Open strDocumentURL
                Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.Author
                Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.Title
                Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.ContentClass
                Set oContentClass = oDocument.ContentClassObject
                ‘Corresponds to Document Profile Name
                Debug.Print Chr(9) & Chr(9) & Chr(9) & oContentClass.Title
                Set rsVersions = oVersion.VersionHistory(strDocumentURL)
                While Not rsVersions.EOF
                    Debug.Print Chr(9) & Chr(9) & Chr(9) & Chr(9) & _
                       "Checked Out: " & rsVersions.Fields _
                       ("urn:schemas-microsoft-com:publishing:IsCheckedOut")
                    Debug.Print Chr(9) & Chr(9) & Chr(9) & Chr(9) & _
                       "Version: " & rsVersions.Fields _
                       ("urn:schemas-microsoft-com:publishing:FriendlyVersionID")
                    rsVersions.MoveNext
                Wend
                rsDocuments.MoveNext
            Wend
            rsFolders.MoveNext
        Wend
        rsWorkspaces.MoveNext
    Wend
    End Sub
    
    The code for EnumerateWorkspaces and additional SharePoint Portal Server code examples using MSDAIPP and PKMCDO can be found in the basPKMCDO standard module in the VBAProject.otm that accompanies this book.

    The KnowledgeServer Object

    The KnowledgeServer object represents a SharePoint Portal Server. KnowledgeServer objects are the primary mechanism for creating and organizing workspaces. The KnowledgeServer object provides methods for creating, deleting, and enumerating KnowledgeWorkspaces. A KnowledgeServer object contains a Workspaces property that returns an ADODB Recordset object containing all the KnowledgeWorkspaces in the KnowledgeServer. You obtain a KnowledgeServer object by opening it with a SharePoint Portal Server URL. Here’s an example:

    oServer.DataSource.Open strServerURL & "/Public/Workspaces"
    Set rsWorkspaces = oServer.Workspaces
    

    The KnowledgeWorkspace Object

    The KnowledgeWorkspace object represents a knowledge workspace which contains content-class definitions and property definitions, as well as the root Categories folder and the root Documents folder. A KnowledgeWorkspace object contains a Subfolders property that returns an ADODB Recordset object that contains all the KnowledgeFolders in the KnowledgeWorkspace. You obtain a KnowledgeWorkspace object by opening it with a workspace URL. Here’s an example:

    oWS.DataSource.Open strWorkspaceURL
    Set rsFolders = oWS.Subfolders
    

    The KnowledgeCategoryFolder Object

    The KnowledgeCategoryFolder object represents a category folder in the SharePoint Portal Server folder hierarchy. A KnowledgeCategoryFolder object is a special type of KnowledgeFolder object. KnowledgeFolder objects provide a physical container for KnowledgeDocument objects. KnowledgeCategoryFolder objects provide a logical grouping of KnowledgeDocument objects. They do not actually contain the KnowledgeDocument objects, because one KnowledgeDocument object can belong to one or more KnowledgeCategoryFolder objects. A KnowledgeCategoryFolder object contains a Subfolders property that returns an ADODB Recordset object that contains all the subcategories in the KnowledgeCategoryFolder. It also contains an Items property that returns an ADODB Recordset object containing all the items that have been assigned to the category represented by the KnowledgeCategoryFolder object. Here’s an example:

    oCategory.DataSource.Open strFolderURL
    Set rsCategories = oCategory.Subfolders
    

    The KnowledgeFolder Object

    The KnowledgeFolder object represents a knowledge folder. All documents are stored in a set of hierarchical folders that operate similarly to file-system directories. Some folders can contain items in addition to documents, such as property definitions and dictionaries. A KnowledgeFolder object contains an Items property that returns an ADODB Recordset object containing all the items in the KnowledgeFolder. Here’s an example:

    oFolder.DataSource.Open strFolderURL
    Set rsDocuments = oFolder.Items
    
    All Recordsets returned by PKMCDO have a RecordCount property equal to -1. Instead of relying on the RecordCount property, you should use a While or Do Until loop to check for the EOF of the Recordset and use the MoveNext method within the loop.

    The KnowledgeDocument Object

    The KnowledgeDocument object represents a document that is contained in the store on a SharePoint Portal Server. You can access many of the default document properties such as Author, Title, Description, Keywords, and Categories directly through the KnowledgeDocument object.

    oDocument.DataSource.Open rsDocuments.Fields("DAV:href")
    Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.Author
    Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.Title
    Debug.Print Chr(9) & Chr(9) & Chr(9) & oDocument.ContentClass
    

    The KnowledgeContentClass Object

    The KnowledgeContentClass object represents a SharePoint Portal Server Document Profile. Each document in SharePoint Portal Server is associated with the KnowledgeContentClass object that defines the object through its ContentClassObject property.

    Set oContentClass = oDocument.ContentClassObject
    ‘Corresponds to document profile name
    Debug.Print Chr(9) & Chr(9) & Chr(9) & oContentClass.Title
    

    The KnowledgeVersion Object

    The KnowledgeVersion object provides methods such as Approve, CheckIn, CheckOut, Publish, and VersionHistory for managing document versions. A KnowledgeVersion object is not a dependent object of a KnowledgeDocument object. You can obtain the versions for a KnowledgeDocument object by calling the VersionHistory method of the KnowledgeVersion object and supplying a URL to the KnowledgeDocument object. The VersionHistory method returns a Recordset object that contains all the versions of the KnowledgeDocument object specified in the URL.

    Set rsVersions = oVersion.VersionHistory(strDocumentURL)
    While Not rsVersions.EOF
     Debug.Print Chr(9) & Chr(9) & Chr(9) & Chr(9) & _
        "Checked Out: " & rsVersions.Fields _
        ("urn:schemas-microsoft-com:publishing:IsCheckedOut")
        Debug.Print Chr(9) & Chr(9) & Chr(9) & Chr(9) & _
        "Version: " & rsVersions.Fields _
        ("urn:schemas-microsoft-com:publishing:FriendlyVersionID")
        rsVersions.MoveNext
    Wend
    
    The object libraries for Word 2002, Excel 2002, and PowerPoint 2002 support SharePoint Portal Server document management with properties and methods that are native to their respective object models. Depending upon the context, you might not have to use PKMCDO to get the job done. However, the Outlook 2002 Object Model does not offer any methods or properties that pertain to document management on SharePoint Portal Server.
    [an error occurred while processing this directive]


    [an error occurred while processing this directive]


    [an error occurred while processing this directive]


    [an error occurred while processing this directive]