Data Model > Accessing the UNICOM Intelligence Data Model > Working with the Metadata Model > MDM custom properties > Setting UNICOM Intelligence Interviewer - Paper Looks in the MDM Document
 
Setting UNICOM Intelligence Interviewer - Paper Looks in the MDM Document
UNICOM Intelligence Interviewer - Paper is an easy-to-use product for formatting paper questionnaires quickly and easily, taking advantage of the features of Word. Central to UNICOM Intelligence Interviewer - Paper are Looks and Look groups. Looks are blueprints for how questionnaire items are to appear in a printed questionnaire. A Look controls which information that is held in the metadata for the questionnaire item is displayed, and how that information is positioned and formatted. You can think of Looks as templates for the questionnaire items. A Look group is a collection of Looks that are designed to be used together to format a questionnaire.
UNICOM Intelligence Interviewer - Paper stores Look information in custom properties. The Look group that has been applied to the specified routing context is stored in a custom property of the routing context called LookGroup, and the Looks that are applied to individual questions and information items are stored in a variable-level custom property called LookName.
The following mrScriptBasic code provides an example of displaying the Look and Look group custom properties stored in an MDM Document after it has been used with UNICOM Intelligence Interviewer - Paper:
Dim MyDocument, MyVariable, MyObject, LookName

Set MyDocument = CreateObject("MDM.Document")

MyDocument.Open("C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Data\Mdd\museum_qq.mdd", , _
MDMLib.openConstants.oREAD)

Debug.Log("Look group: " + MyDocument.RoutingContexts.Item["Paper"].Properties["LookGroup"]["Question"])

For Each MyObject In MyDocument.Fields
If MyObject.ObjectTypeValue = MDMLib.ObjectTypesConstants.mtClass Then
For Each MyVariable In MyObject.Fields
LookName = MyVariable.Properties["LookName"]["Question"]
If LookName <> "" Then
Debug.Log(MyVariable.Name + ": " + LookName)
End If
Next
Else
LookName = MyObject.Properties["LookName"]["Question"]
Debug.Log(MyObject.Name + ": " + LookName)
End If
Next
Here are the first lines of some typical output. Note that you will see the custom property values only if you have previously used the museum_qq.mdd sample Document with UNICOM Intelligence Interviewer - Paper.
Look group: Contemporary
Serial: Contemporary::Numeric Box:
title: Contemporary::Statement:
head1: Contemporary::Statement:
entranc: Contemporary::1 Column Narrow:
intro: Contemporary::Statement:
gender: Contemporary::1 Column Narrow:
age: Contemporary::1 Column Narrow:
educati: Contemporary::1 Column Narrow:
school: Contemporary::1 Column Narrow:
biology: Contemporary::1 Column Narrow:
certifi: Contemporary::1 Column Narrow:
before: Contemporary::1 Column Narrow:
visits: Contemporary::Numeric Box:
Sometimes you may want to change the Look group applied to a Document or the Looks applied to particular questions outside of UNICOM Intelligence Interviewer - Paper. This is easy to do programmatically and the following mrScriptBasic example sets the LookName custom property on the interes question to the 2 Column Look in the Contemporary Look group. This means that the next time you open the Document in UNICOM Intelligence Interviewer - Paper, this Look will automatically be applied to the question:
Dim MyDocument, MyVariable

Set MyDocument = CreateObject("MDM.Document")

MyDocument.Open("C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Data\Mdd\museum_qq.mdd", , _
MDMLib.openConstants.oREADWRITE)

Set MyVariable = MyDocument.Fields["interes"]
MyVariable.Properties.Item["LookName"]["Question"] = "Contemporary::2 Column:"

MyDocument.Save("C:\Program Files\IBM\SPSS\DataCollection\7\DDL\Output\museum_qq.mdd")
MyDocument.Close()
See also
MDM custom properties
Custom properties in use in UNICOM Intelligence products
Creating and reading custom properties
Working with the Metadata Model