Using the Ribbon Schema

The schema file for ribbon customizations is called customui.xsd. Using Visual Web Developer, the first thing to do is create a new XML file. Once the file is created, click the button in the Schemas property to open the Schemas dialog box. Click the Add button at the bottom of the dialog box to browse to the customui.xsd XML schema that is included in the 2007 Office System: XML Schema Reference. Figure 12-2 shows the schema file added to the dialog box.

XSD Schemas

Check the box for each schema you would like to use for validating the current XML document, or click the Add button to locate a new schema,

B L^ C:\Program Frtes\Microsoft Visual StudioS B I Common7

□ IDE\Poficy\Schemas

□ H Policy.xsd (http://schemas.mlcrosoft.com/VSPolicy/PDLSchema n|Ji| TDLSchema.xsd (http://www,microsoft,com/schema/Enterprise

B [ZlL^ packages\SDM\Schema

□ S SystemDefinitionModel.xsd (http://'schemas.microsoft.com/Sy: B l/ 1xml\Schemas

B 1033

I I Microsoft,Build,xsd (http://schemas,microsoft,com/developer.; I I io snippetformat.xsd (http://schemas.microsoft.com/VisualStudii I I vscontentxsd [http://schemas.microsoft.com/developer/vscon' Q^j vstemplate.xsd (httpV/schemas.microsoft.com/developer/vster I I & addinschema.xsd (http://schemas,microsoft,com/AutomationExtei

□ 1 adrotator.xsd (http;//5chema5.microsoft.com/AspNet/AdRotator-/i

□ adrotatorl_O.X5d (httpV/schemas.microsoft.com/AspNet/AdRotat< n & catalog,xsd (http://schemas,microsoft,com/xsd/catalog)

Q 0 customUI.xsd (http://schemas.microsoft.com/office/2006,1ül/cust

msdata.xsd (urn:schemas-microsoft-com:xmI-msdata) msxsl.xsd (urn:schemas-microsoft-com:xslt)

1 1

Si

&

1 1

Mi

LJ

a

msdata.xsd (urn:schemas-microsoft-com:xmI-msdata) msxsl.xsd (urn:schemas-microsoft-com:xslt)

Figure 12-2

You can save the step of adding the schema by copying customui.xsd to %programfiles%\Microsoft Visual Studio 8\Xml\Schemas.

Writing the XML

Once you point Visual Web Developer to the schema, you're ready to start writing. The root node of a ribbon customization is:

<customUI xmlns="http://schemas.microsoft.com/office/200 6/01/customui">

A root node is the node at the top of an XML document. There is one and only one root node in any given document.

The namespace specified by the xmlns attribute is known as the default namespace. It defines the elements and attributes used when you write a ribbon customization. Within a customization, you can create a Ribbon, modify commands in the Quick Access Toolbar, or modify the Office Menu. You'll create a Ribbon here and look at the other options later in this chapter.

Next, tell the XML that you are creating a Ribbon by adding the ribbon tag to define it:

<ribbon startFromScratch="true">

The startFromScratch attribute tells Access whether to display the built-in Ribbon. Use the following XML to create an empty Ribbon for your database as shown in Figure 12-3.

<customUI xmlns="http://schemas.microsoft.com/office/200 6/01/customui">

<ribbon startFromScratch="true"/> </customUI>

<customUI xmlns="http://schemas.microsoft.com/office/200 6/01/customui">

<ribbon startFromScratch="true"/> </customUI>

AEk Access Objects *

Tables it

1 MSysAccessStarage 13 WSysACEs "1 MSysComDreiCalumns'

Viry,N. I'F..c 1'iTrM.j.T it v 'jr-rF'F 1 v'-.y".n. -r' f'f". ff'iij,.

m-.y'.n. i'i:..f-f'f".ffm,j. if,: >:i;f-fiv iiil WSFsMai-PsntOliferilOs

3 MSTsb&jecis

Si V

"1 WSysRitaticnihipr

O USysRibbors

AEk Access Objects *

Tables it

1 MSysAccessStarage 13 WSysACEs "1 MSysComDreiCalumns'

Viry,N. I'F..c 1'iTrM.j.T it v 'jr-rF'F 1 v'-.y".n. -r' f'f". ff'iij,.

m-.y'.n. i'i:..f-f'f".ffm,j. if,: >:i;f-fiv iiil WSFsMai-PsntOliferilOs

3 MSTsb&jecis

Si V

"1 WSysRitaticnihipr

O USysRibbors

When you create a Ribbon from scratch, the Office menu is also modified as shown in Figure 12-4. The Office menu contains many commands that are central to the application itself.

Figure 12-4

Later in this chapter, you'll build two solutions — one that is incorporated into the Access Ribbon and one that you build from scratch.

0 0

Post a comment