SharePoint Development from a Documentation Perspective

Andrew May

May, 2004

  • Andrew May's WebLog

    Creating Personalized Thank You Cards with Publisher 2003 (Part 4 of 4)


    (Previously: Part 1, Part 2, and Part 3)

    Perform the Merge

    Now you’re ready to actually preview how the cards will look when merged. To set up the data source, do the following:

    ·         Sort the records based on Gift? = True, so you select only the records for people who sent you gifts.

    ·         If you’re planning on performing more than one merge, sort on Record merged? = False, so you only select the records that haven’t already been merged.

    Preview the cards to make sure they look like you want them, and then perform the merge to a new publication.

    So what does the final card interior look like? Well, here’s one of ours:

    Again, I’ve formatted the text that’s coming from merge records in blue, so you can more easily see the personalization of each card.


    (What, you didn’t think I was going to post a clear picture of my ugly mug on the web, did you? What’s the point of the witness protection program if I do something like that?)

    Once you’ve performed the merge and saved the merged file, remember to go back and set the Record merged? field to True for those records you’ve just merged. That way they won’t be included in the next merge you perform, so you won’t get duplicate cards.

    Print the Cards

    When you print the merge results, you’ll actually be printing them on the other side of the card exterior, which you printed earlier. It’s a good idea to print a test page or two to make sure you’ve got the paper fed correctly into the printer. For example, in our case, I had to make sure that the gift picture on the inside printed on the other side from the card front.

    Once you’ve printed the cards, all that remains is to cut them, fold them, and mail them to your loved ones. Seriously, the response we got from the cards was wonderful. People gushed; they really loved receiving such a unique personalized card. Except for the people who thought we should have taken all the money we obviously spent on this expensive service and used it to provide more cake.

    And I’m sure you’ve realized that you can use this method for a lot more than just wedding gifts. The next time someone is having a birthday party, have someone there taking digital pictures as they unwrap their loot. A few days later, everyone who gave a present receives a nice personalized card with a picture of the birthday girl/boy’s look of joy as they open the present that person brought.

    But even after this success, my fiancée still put the brakes on my idea of performing our vows as a PowerPoint presentation.


    Yeah, that was probably a good call on her part.

  • Andrew May's WebLog

    Creating Personalized Thank You Cards with Publisher 2003 (Part 3 of 4)


    Now that we’ve got the card exterior designed, we’re ready to work on the catalog merge.

    Create the Data Source

    Next, create the data source for the cards. We used the same one we used for addressing the invitation. We just added several fields to the spreadsheet:

    ·         Salutation: The informal name you use for the person, like “Uncle Jim and Aunt Jane”, as opposed to the formal name you’d use on the wedding invitation.

    ·         Gift?: This is just a simple yes/no field. You’ll use it to filter the records you’ll use to perform the catalog merge.

    ·         Gift: Informal description of whatever the gift actually was.

    ·         General comment: Whatever heart-felt sentiment you want to say. Because Publisher only prints the first 256 characters in a field, I added two comment field next to each other. Each field is roughly enough for two or three short sentences.

    ·         General comment 2: See above.

    ·         Picture: The path to the picture of you with this gift.

    ·         Record merged?: If you’re not going to merge and print the cards all at once, you might want to include a data field to designate whether or not the card has been included in a merge. Just remember to change the value from False to True once you create the merge and print it. That way you can sort out the printed cards, so they won’t be included in any subsequent merge.

    Fill in the data source records, and you’re ready to create the card interior itself.

    Design the Card Interior

    Below is the design I came up with for the inside of our Thank You cards. Notice that the inside of the card is one large catalog merge area, sized so that it repeats twice per page. I placed the picture of us with the gift on the inner side of the card front, with the personal thank you comments underneath. But that’s hardly the only way to do it. Play around, see what works for you.

    I’ve marked the merge fields blue in the screen shot below to emphasize them, so you can see what they look like before the merge happens. The merge fields don’t appear in blue normally.


    For the purpose of this blog, I’m assuming you know how to create and perform a catalog merge. If you don’t, take a look at these Office Online resources:

    Create a catalog merge

    Demo: Catalog merge turns data into designs

    Create catalogs or directories

    Or, for you programming types, I just happen to have written a few articles on the topic:

    Create Catalogs with Publisher 2003

    Sort and Filter Your Data for Mail or Catalog Merges in Publisher 2003

    Tomorrow, we bring it all together.

  • Andrew May's WebLog

    Creating Personalized Thank You Cards with Publisher 2003 (Part 2 of 4)


    Now that we’ve covered the basics of the project, let’s jump into the details:


    Here’s the household items you’ll need for this project:

    ·         Elmer’s glue (or paste)

    ·         Safety scissors

    ·         A 6-inch length of string

    ·         Glitter

    Oh wait, that’s a different arts and craft project. The tools for this one are a little more upscale:

    ·         Microsoft Office Publisher 2003

    ·         A digital camera capable of downloading images to a computer

    ·         A color printer capable of producing photo-quality prints (or access to one at work)

    ·         A computer (preferably a laptop or TabletPC)

    ·         A paper cutter (you can substitute safety scissors if you must)

    Now, if you don’t already have these basic household items, don’t be afraid to include them in your wedding budget, especially if her father’s picking up the tab. This works best if you don’t call them out in the budget as individual line items. Group them with similar expenses. For example, go ahead and roll the cost of the digital camera into the “Wedding party corsages” line item, or expense the photo-quality color printer under “Table decorations (misc.).”

    Bribe a Friend

    Actually, I forgot an additional item you’ll need for this project: a friend willing (or willing to be bribed) to take the pictures of the happy couple with each gift. If they can work a digital camera, even better. Alcohol, chocolate, and/or food make excellent inducements, depending on the friend. One piece of advice, though: don’t be too free with the alcohol until all the pictures are taken. Also, things go most smoothly when you unwrap and sort the presents before the camera person gets there. A laptop’s great for entering the gift information in the spreadsheet as you open each gift.

    One thing we hadn’t anticipated was how many people would be giving us the universal gift: cash. Or gift cards/certificates to the stores included on our registry. Since we didn’t feel a picture of us fondling a gift check, or rolling in a pile of low-denomination bills was appropriate, for these generous souls we included a picture of us on our wedding day.

    Now granted, you could take the pictures with a conventional camera, and scan them into the computer later. But the great thing about digital is there’s no wasted film, you can be sure you’ve got the photo you want as soon as you take it, and you don’t have to get the photos developed. And in the end, isn’t your wedding worth it?

    (If she buys that argument, my work here is done.)

    Once you’ve got the pictures taken, download them to the computer.

    Design the Card Exterior

    You’ll use Publisher for the rest of the steps. First, design the outside (front and back) of the card. In our case, we made the cards 5.5 by 8.5 (5.5 by 4.25 when folded) so that two would fit on a regular 8.5 by 11 inch sheet. So the basic layout looked like this:

    Remember that anything on the back of the card needs to be upside-down in your layout, so that’s correct once the card has been cut and folded. To flip shapes, including text boxes, select the shape and then, from the Arrange menu, click Rotate or Flip, and then click Flip Vertical.

    Then print as many as you’ll need.

    The ruler guides mark quarter-inch borders around the actual faces of each card . Once the cards were done, we cut them on the center vertical ruler, and folded them along the center horizontal guide. Just don’t cut yours yet, because we still need to print the personalized inside of the card.

    Which we’ll cover tomorrow.

  • Andrew May's WebLog

    Creating Personalized Thank You Cards with Publisher 2003 (Part 1 of 4)


    Well, it’s spring time again, and of course that means one thing: Tech Ed. But rather than focus on the definitive Microsoft conference for building, deploying, securing, and managing connected solutions, I’d like to take a few entries and address another industry that gears up every spring.

    That’s right, it’s wedding season.

    So over the next few entries I’d like to discuss something very cool my wife and I came up with for our wedding: using Publisher to create personalized Thank You cards for wedding gifts. We created an individual Thank You card for everyone who sent us a gift. Printed inside each card was a picture of us holding that person's particular gift, along with printed comments specific to that person.

    We personalized the Thank You because we wanted people to know how important they were to us and how much their gifts meant. Also, since our registry was online, and we had family and friends all over the country, a lot of the gifts got ordered online and shipped directly from the store. In many cases, the people buying the gifts had never really seen what they were sending us.

    Pretty cool, huh? Trust me, people loved these cards.

    And the best thing was, using Publisher’s catalog merge functionality, it was easy. We did all this through the user interface; I didn’t have to write a single line of code to customize or extend Publisher’s functionality. (So consider this a warning: the following entries don’t contain a single line of code.)

    Unnecessary Backstory

    Anyway, about six months ago, I got married. (That in itself is a success story, but not one in which Microsoft products played a large part. I assume. Maybe she created a mathematically-weighted list of my pros and cons in Excel and the balance sheet came out in my favor. I don't know. But if that's the case, she should probably check her math.) No, the cool thing we did with Publisher was to create personalized Thank You cards.

    Once we decided to be married, we actually realized that we’d have to go through the process of getting married. For some unknown reason, we decided not to elope, and instead opted for a simple wedding. ‘Simple wedding’, of course, being equivalent to ‘military intelligence’ on the oxymoron rating scale.

    Simple as our wedding was, most of the planning fell to my fiancée. Once I realized the incredible stress and pressure she was under from dealing with the marital-industrial complex, I resolved to help and support her in any way humanly possible that didn't involve actually dealing with any aspects of the planning process that didn't interest me. In short, I began looking for those activities that would let me continue to dink on the computer while giving the appearance of being an active participant in planning my own wedding. I spent long hard hours on such tasks as generating facility expense comparisons, keeping our invitation address database current, maintaining our website, and much more. I did this incidentally to move our plans for the blessed day forward, but primarily just to avoid being dragged into interminable discussions of floral arrangement plans and linen design options.

    (And trust me, the wedding was much better for my lack of involvement. One of the few times I actually rendered an opinion, it nearly doomed the whole damn thing. Just remember: at weddings, people want and expect cake. Any cake. People do not want wonderful and expensive lemon torte with fresh-picked organic berries--unless it is served on cake. If you tell people ahead of time there will be no cake, they will revolt, and threaten to bring their own cake and serve it tail-gate style out in the reception parking lot. Seriously. Cake.)

    Publisher 2003 was great for stuff like this. I created our website in Publisher; I designed our Save the Date cards and the wedding program in Publisher. I even used Publisher's mail merge feature to address the invitations. Those all turned out looking professional and pleased my fiancée immensely. But the one thing I'm particularly proud of was our Thank You cards.

    We used Publisher's catalog merge functionality. It was easy. Here's the basic steps, each of which I discuss in more detail later:

    ·         Take digital photos of the happy couple with each gift

    ·         Design the outside of your Thank You card

    ·         Create the data source for the catalog merge

    ·         Design the inside of the card as a catalog merge area

    ·         Perform the catalog merge

    ·         Print the cards

    In my entry tomorrow I’ll cover the first two of these steps.

  • Andrew May's WebLog

    OneNote Namespace Change for SP1


    Here’s a heads-up for developers that are using the SimpleImport interface available in the OneNote 2003 Service Pack 1 (SP1) Preview. Be advised that the namespace for the Import method will be different in the final released SP1 from what it is in the Preview version.

    The current namespace for the OneNote SP1 Preview is:

    While the final namespace for OneNote SP1 will be:

    From what I understand, it’s become standard procedure here in Office to use a ‘beta’ namespace for early versions of a product, and then switch to another namespace once the schema has been finalized. Just be advised that if you’re programming against the Preview namespace, you’ll need to update your code for the new namespace in order for it to be compatible with the final OneNote SP1, once it’s released.

    I’ve already edited my blog entry detailing how to use the SimpleImport functionality, but I wanted to call this out in a separate entry for anyone who’s already using the documentation.

  • Andrew May's WebLog

    Customizing OneNote 2003 SP1 Using New Command Line Switches


    The last aspect of the OneNote SP1 developer story that we should talk about is the half-dozen or so command line switches that OneNote SP1 has added. Once again, here's a draft version of an article that we'll publish on MSDN once OneNote 2003 SP1 is available. The information has been reviewed by the OneNote team, but this is still draft documentation, and should be considered as such.

    Here you go:


    Applies To:

        Microsoft Office OneNote 2003 SP1 Preview

    Summary:    OneNote 2003 SP1 Preview features several new command line switches, including switches you can use to record video notes, import content, and collaborate with others.


    For SP1 Preview, OneNote 2003 has added six new command line switches that enable you to customize OneNote’s performance. The first three new switches let you automatically start, pause, and stop recording a video note. Two others deal with collaborating with others in a shared work space. The final switch duplicates the content importing functionality of OneNote’s new CSimpleImporter interface.

    You can employ these command line switches in scripts, application programming, or even include them in desktop shortcuts.

    Note These extensibility features are only available when you upgrade to the OneNote 2003 Service Pack 1 (SP1) Preview.

    Running OneNote with Command Line Switches

    You can modify how OneNote 2003 starts by adding switches when you launch OneNote from the command line. Several of these switches where available in the initial release of OneNote 2003. For example, you could open OneNote to a specific page, print a specific page, start audio recording, or open a side note. OneNote 2003 SP1 extends this functionality with the new switches.

    To use a command line switch to customize how OneNote starts, pass the command line a string composed of:

    ·         The fully qualified path to the OneNote application, and

    ·         The switch you want to use, plus strings for any parameters it requires.

    These switches work whether or not OneNote is already open. If you execute a command line switch and OneNote is already running, the switch action executes on the currently running instance of OneNote.

    The path of the OneNote exe can be found in the registry key: HKEY_CLASSES_ROOT\CLSID\{22148139-F1FC-4EB0-B237-DFCD8A38EFFC\LocalServer32

    Using Switches to Create Audio and Video Notes

    You can use four of the new switches to automatically create OneNote video notes:

    ·         /videonote, which starts OneNote recording on the active page, and lets you choose the audio and video devices to use, as well as specify a custom profile.

    ·         /pauserecording, which pauses video or audio recording in the current instance of OneNote. You can resume recording by passing this command line switch again.

    ·         /stoprecording, which stops recording the video or audio note in the current instance of OneNote.

    ·         /recordingprofile, which lets you use an external recording profile, instead of built-in profiles from OneNote.

    Note that the pauserecording and stoprecording switches also work with audio notes. You can use audionote, a command line switch present in OneNote 2003, to automatically start recording audio on the active page.

    Specifying Audio and Video Devices

    The videonote switch consists of the switch name and three optional string parameters:

    /videonote videodevice audiodevice recordingprofilepath

    To find the device you’ve specified, OneNote takes each string argument and compares it to the strings it gets from the system enumerating the devices installed. You do not need to pass the entire string for a device; instead, the string should be any unique subsection of that string, so OneNote can correctly determine the intended device. OneNote uses the first device it encounters whose string matches. If the string is not unique to a single device, OneNote may select the wrong device. Note that the class ID by itself is not sufficient to distinguish between devices.

    For example, suppose you had the following two video capture devices installed on your system:



    The class ID in each case is identical. However, each string does contain information that is unique. So you could pass the following switches to designate the first and second video devices, respectively:

    OneNote.exe /videonote vid_046d&pid_08b2

    OneNote.exe /videonote vid_046d&pid_08f0

    Similarly, suppose you had the following three audio capture devices installed:

    @device:cm:{33D9A762-90C8-11D0-BD43-00A0C911CE86}\Intel(r) Integrated Audio
    @device:cm:{33D9A762-90C8-11D0-BD43-00A0C911CE86}\USB Audio Device

    Again, the class ID is the same in each case, but each string contains unique information to distinguish which device you want to specify.

    So, to start OneNote recording a video note, using the first video and audio device in each list, you would pass the following command line switch:

    OneNote.exe /videonote vid_046d&pid_08b2 “Intel(r) Integrated Audio”

    Also be aware that, because a space serves as the delimiter between parameters, you cannot pass an argument string that contains a space, unless you enclose the string in quotes. If you pass an argument string that contains a space without enclosing it, OneNote assumes the space signifies the end of that string, and the switch fails.

    If you do not specify a video or audio device, OneNote uses the default device, if one is available.

    Specifying a recording profile

    Two of the command line switches enable you to specify a custom recording profile. You can either:

    ·         Use the recordingprofile switch.

    ·         Use the optional recordingprofilepath parameter of the videonote switch.

    The recordingprofile switch has the following signature:

    /recordingprofile filepath

    Filepath is a required parameter that takes a string representing the fully-qualified path to a recording profile file.

    Alternately, you can specify a custom recording profile when you use the videonote switch. That switch’s optional recordingprofilepath parameter also takes a string representing the fully-qualified path to a recording profile file.

    A recording profile is a text file contains configuration information concerning video and audio recording, such as bit rate, sampling, and decoding. You can generate recording profiles using WMGenProfile, which is included as a sample application in the Media Windows Media Format 9 Software Developer’s Kit (SDK). For more information on recording profiles, see the SDK.

    Using Switches to Collaborate

    The next two command line switches we’ll discuss involve the important collaboration functionality added to OneNote 2003 SP1. Now, you can share a notebook page with one or more users, with each user able to dynamically add, edit, and delete content in real time to the page, and each user retaining a copy of the notebook page at the end of the session.

    One user starts the session by setting up a shared session. The user selects the notebook page they want to share, then specifies a password for the session if desired. He can then invite other users to join the session. Users who want to join the session must specify the address (either IP or network domain) of the computer on which the session was started, and the password if one has been set. The user who started the session also determines whether other users have the ability to edit the shared notebook page.

    The command line switches, startsharing and joinsharing, enable you to programmatically initiate or join a shared session, respectively.

    The startsharing switch has the following signature:

    /startsharing password filename

    As its name implies, this switch initiates a shared session from the computer on which it’s executed. The filename string parameter refers to the notebook section to share. The filename string must be a fully-qualified path to the section, including section name and file extension (that is, .one). The page shared is the page most recently selected in that section.

    The password parameter is optional. If you specify a password, all other users are required to specify that password in order to join the session. The password can contain any characters; however, strings that contain spaces must be enclosed in quotes. You will need to communicate the computer address and session password to participants in order for them to join the session.

    Once the shared session has been started, other users can join and collaborate. The joinsharing switch has the following signature:

    /joinsharing sessionaddress password filename

    Executing this command line switch adds the computer to the shared session. In order to join a session, you must know the address of the computer that started the session, and the password, if one has been specified. The sessionaddress parameter takes a string that represents the address of the computer that started the session; this address may be the computer’s IP address, or full network domain name. The password and filename parameters represent the password for the session, if one has been set, and the section of the notebook that is being shared, respectively. You will need to receive this information from the session initiator in order to join the session. The filename parameter is optional; if you omit it, OneNote opens to the last section opened. You can only share one notebook section at a time.

    To start or join a session using the user interface, from the Tools menu select Shared Session, and then click Start Shared Session or Join Shared Session.

    The following function programmatically initiates a shared session in OneNote. The calling application passes string representing the location of the OneNote application and the notebook section to share. The example function generates a random numeric string to use as a password, then starts a new process that initiates a shared session in OneNote. The function then returns the password to the calling application. Note that the auto-generated password offers no extra security, and is only done for convenience.

    Public Function ShareOneNote(ByVal appLocation As String, _

        ByVal section As String) As String

        Dim NoteSwitch As String

        Dim OneNoteProcess As Process

        Dim Ran As New Random

        Dim Password As String


        'Generate a random numeric password

        'NOT for security, just for convenience

        Password = Ran.Next(100000001).ToString

        'Compose command line switch

        NoteSwitch = " /startsharing " & Password & " " & section

        'Pass command line to OneNote application

        OneNoteProcess = Process.Start(fileName:=appLocation, _


        'Return generated session password to calling application

        Return Password


    End Function

    Using the Import Switch to Place Content in OneNote

    You can also use a command line switch to automatically import images, ink, and HTML into OneNote. You can even create the folders, sections, or pages onto which you want to place your content.

    The import switch consists of the switch name and a single required parameter:

    /import filename

    The filename parameter takes an XML file that specifies:

    ·         The folders, sections, and pages on which you want to place content. If a folder, section, or page does not exist, OneNote creates them.

    ·         Details of the images, ink, and outlines (in HTML form) that you want to place on each specified page.

    The file must adhere to the requirements of The OneNote 1.1 SimpleImport XML Schema.

    This switch duplicates some of the functionality of OneNote’s CSimpleImporter interface. For more information about this interface, including a discussion of the OneNote SimpleImport schema, see Importing Content into OneNote 2003 SP1 Preview.

    Using Other Command Line Switches

    Below is a list of the command line switches previously available in OneNote 2003. All parameters take strings as arguments.

    / filename

    Opens a file, where filename is a fully qualified file name, including the disk, folder path, and .one file extension.

    /new filename

    Creates a new section, called New Section 1, in the default folder (such as My Notebook), although filename is a required parameter that includes the disk and folder path and any unique file name with the .one file extension.

    Note  If a section called New Section 1 already exists in the folder, the number in the section name is increased incrementally, such as New Section 2.

    /newfromexisting folder filename

    Copies the file that is specified by filename to the folder that is specified by folder and opens the file.

    /openro filename

    Opens a file as read-only, where filename is a fully qualified file name, including the disk and folder path and .one file extension.

    /print filename

    Prints a file, where filename is a fully qualified file name, including the disk and folder path and .one file extension.

    /forcerepair filename

    Runs the file repair feature for a file, where filename is a fully qualified file name, including the disk and folder path. This is the same file repair feature that OneNote automatically runs if it detects file corruption while opening a file.


    Starts OneNote in a miniature window, open to the Side Notes section by default.


    Starts recording on the active page.


    Opens the New task pane.


    Pastes the contents of the Clipboard.


    Command line switches offer an easy-to-implement way of customizing OneNote not just from the command line, but through scripts, code, or even desktop shortcuts.

Page 1 of 1 (6 items)