Test Scribe – Developer Guide
Couple of days ago I wrote about How To Change Test Scribe Template since than I got plenty of emails on that subject asking me to supply more and more information about changing Test Scribe Template.
Many people thinks that:
“The output generated by Test Scribe is not customizable in this release.”
But this is not fully correct, you can change the Test Scribe template but this will require couple of hacks….. But possible 
I recommend you to read the How To Change Test Scribe Template article to understand what need to be change and more about the tt files, controls the Test Scribe document.
Test Scribe Command List
Text
Add text to the Test Scribe document you need to use the SprText command:
SprText(“Hello World”)
To use built in string reference (table bellow) you need to call SprHost.Resources.GetString(Name)
SprText(SprHost.Resources.GetString("TestCaseLabel"))
SprText(“Section Name”, SprHost.Resources.GetString("TestCaseLabel"))
Using String.Format:
TestCasesLabel = Test Cases ({0})
SprText(String.Format(CultureInfo.CurrentCulture, SprHost.Resources.GetString("TestCasesLabel"), suite.AllTestCases.Count))
Hyperlink
Hyperlinks in Test Scribe are very powerful, you can add links that will activate MTM objects directly or just a simple hyperlink.
SprHyperlink(Text, Uri Value)
How to open Test Plan (In MTM) From the Word Document using the BuildUrl method:
SprHyperlink(TestPlan.Id.ToString(), BuildUrl("testing/testplan/open?id=" + TestPlan.Id.ToString()))
Result: mtm://localhost:8080/tfs/defaultcollection/p:TeamProject/testing/testplan/open?id=3

Images
Adding built in images or new images as follow:
SprImage("/Images/TestCase_16.png")

Paragraph
This is with no doubt the must popular method you will use when customizing the Test Scribe Template, Create new Paragraph.
Inside the paragraph you can use all the above methods.
SprParagraph
(
"Heading4",
SprImage("/Images/TestCase_16.png"),
SprText(SprHost.Resources.GetString("TestCaseLabel")),
SprHyperlink(testCase.Id.ToString(), BuildUrl("testing/testcase/open?id=" +
testCase.Id.ToString())),
SprText(String.Format(CultureInfo.CurrentCulture, SprHost.Resources.GetString
"ItemHeaderFmtString"), testCase.Title))
);
Test Scribe Images Reference
There are set of images inside “Microsoft.TeamFoundation.TestManagement.Tools.TestScribe.dll”, you can add your own images inside the template.
| Name | Value |
| Aborted_16 | ![clip_image001[6] clip_image001[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0016_thumb_21ADCD16.png) |
| Blocked_16 | ![clip_image002[6] clip_image002[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0026_thumb_4DEA53FA.png) |
| Bug_16 | ![clip_image003[6] clip_image003[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0036_thumb_451A4BAE.png) |
| Error_16 | ![clip_image004[6] clip_image004[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0046_thumb_7156D292.png) |
| Failed_16 | ![clip_image005[6] clip_image005[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0056_thumb_368F29BC.png) |
| Inconclusive_16 | ![clip_image006[6] clip_image006[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0066_thumb_2DBF2170.png) |
| InProgress_16 | ![clip_image007[6] clip_image007[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0076_thumb_56E6B9AE.png) |
| None_16 | ![clip_image008[6] clip_image008[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0086_thumb_13BB3B81.png) |
| NotExecuted_16 | ![clip_image009[6] clip_image009[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0096_thumb_10C5D6CE.png) |
| Passed_16 | ![clip_image010[6] clip_image010[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0106_thumb_3576EE45.png) |
| Paused_16 | ![clip_image011[6] clip_image011[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0116_thumb_217D5BAF.png) |
| Pending_16 | ![clip_image012[6] clip_image012[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0126_thumb_1F605CE6.png) |
| Queued_16 | ![clip_image013[6] clip_image013[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0136_thumb_565A3B1F.png) |
| RunComplete_16 | ![clip_image014[6] clip_image014[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0146_thumb_348E628E.png) |
| RunInitializing_16 | ![clip_image015[6] clip_image015[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0156_thumb_0BA34D85.png) |
| SharedStepSet_16 | ![clip_image016[6] clip_image016[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0166_thumb_252ADAB2.png) |
| TestCase_16 | ![clip_image017[6] clip_image017[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0176_thumb_02F2CF2C.png) |
| TestConfiguration_16 | ![clip_image018[6] clip_image018[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0186_thumb_599B872D.png) |
| TestConfiguration_32 | ![clip_image019[6] clip_image019[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0196_thumb_700E25B4.png) |
| TestPlan_16 | ![clip_image020[6] clip_image020[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0206_thumb_2D4EDA7C.png) |
| TestPlan_32 | ![clip_image021[6] clip_image021[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0216_thumb_3D0E6F80.png) |
| TestSettings_16 | ![clip_image022[6] clip_image022[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0226_thumb_61BF86F7.png) |
| TestSettings_32 | ![clip_image023[6] clip_image023[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0236_thumb_43B15336.png) |
| TestStep_16 | ![clip_image024[6] clip_image024[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0246_thumb_00F207FE.png) |
| TestStepValidate_16 | ![clip_image025[6] clip_image025[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0256_thumb_702A5D4F.png) |
| TestSuiteDynamic_16 | ![clip_image026[6] clip_image026[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0266_thumb_497BD102.png) |
| TestSuiteRequirement_16 | ![clip_image027[6] clip_image027[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0276_thumb_475ED239.png) |
| TestSuiteStatic_16 | ![clip_image028[6] clip_image028[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0286_thumb_3E2296F8.png) |
| Timeout_16 | ![clip_image029[6] clip_image029[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0296_thumb_4324D4A7.png) |
| Warning_16 | ![clip_image030[6] clip_image030[6]](http://blogs.microsoft.co.il/blogs/shair/clip_image0306_thumb_33358FE3.png) |
Test Scribe String Reference
When customizing the Test Scribe template you can use the default values inside “Microsoft.TeamFoundation.TestManagement.Tools.TestScribe.dll” to avoid static text inside the tt file extension.
| Name | Value |
| ActiveDatesLabel | Active dates: |
| AdditionalNotesHeaderLabel | Additional Notes |
| AreaLabel | Area: |
| AssignedToLabel | Assigned to: |
| AutomatedTestNameLabel | Automated test: |
| AutomatedTestRunLabel | Automated |
| AutomatedTestSettingsLabel | Automated Settings {0}: {1} |
| AutomatedTestType | Automated |
| BugLabel | Bug |
| BugsLoggedLabel | Bug(s) logged: |
| BuildDefinitionLabel | Build definition: |
| BuildLabel | Build: |
| BuildNumberLabel | Build(s): |
| BuildQualityLabel | Build quality: |
| BuildUnassignedLabel | Unassigned |
| CommaSeparator | {0} |
| CompletedWithIssues | completed with issues. |
| ConfigDetailsDescription | You can use one or more configuration variables to create a test configuration. Each configuration variable defines one characteristic of the testing environment. For example |
| ConfigurationDetailsHeaderLabel | Configuration Details |
| ConfigurationLabel | Config {0}: {1} |
| ControllerNoLongerExists | <Agent no longer exists> |
| DateRangeSeparator | - |
| DayFormatString | {0} day{1}{2} |
| DurationLabel | Duration: |
| EnterNotesHereLabel | <Enter notes here> |
| EnvironmentNoLongerExists | <Environment no longer exists> |
| ExpectedValueColumnHeader | Expected Value |
| Failed | failed. |
| FailedTestsByTypeChartLabel | Failed Tests by Type |
| FailureType_KnownIssue | Known issue |
| FailureType_KnownIssues | Known issues |
| FailureType_NewIssue | New issue |
| FailureType_NewIssues | New issues |
| FailureType_Regression | Regression |
| FailureType_Regressions | Regressions |
| FailureType_Unknown | Unknown |
| FailureTypeLabel | Failure type: |
| HourFormatString | {0} hour{1}{2} |
| IncludedRunsHeaderLabel | Included Runs ({0}) |
| InProgress | in progress. |
| ItemHeaderFmtString | : {0} |
| IterationLabel | Iteration: |
| LocalOnlyEnvironmentName | <Local> |
| ManualTestRunLabel | Manual |
| ManualTestSettingsLabel | Manual Settings {0}: {1} |
| ManualTestType | Manual |
| MetadataLabelFormat | {0}: |
| MinuteFormatString | {0} minute{1} |
| NameValueSeparator | | |
| NoBugsLinkedLabel | No bugs logged |
| NoBuildAssigned | <Not assigned> |
| NoControllerUsed | <No agent used> |
| NoResultsFoundLabel | No results found. |
| NotSetLabel | Not set |
| OtherTestResolutionName | {0} Others ({1}%) |
| Outcome_Unspecified | Active |
| OutcomeSummaryHeaderLabel | Outcome Summary |
| OwnerLabel | Owner: |
| Passed | passed successfully. |
| PlanState_Active | Active |
| PlanState_Inactive | Inactive |
| PriorityLabel | Priority: |
| RelatedBugsHeader | Related Bugs ({0}) |
| ResultLabel | (result) |
| RunByLabel | Run by: |
| RunDateStartedLabel | Date started: |
| RunTypeLabel | Run type: |
| SecondFormatString | {0} second{1} |
| SingleTestRunSummaryHeader | Test run {0}: {1} {2} |
| State_Aborted | Aborted |
| State_Blocked | Blocked |
| State_Error | Error |
| State_Failed | Failed |
| State_Inconclusive | Inconclusive |
| State_None | None |
| State_NotExecuted | Not executed |
| State_NotStarted | Not started |
| State_Passed | Passed |
| State_Timeout | Timeout |
| State_Waiting | Waiting for Test Controller |
| State_Warning | Warning |
| StatisticFormatString | {0} {1} ({2}%) |
| StepNumberColumnHeader | # |
| SuiteDetailsDescription | You can group your test cases together by organizing test cases into a test suite hierarchy in your test plan. By grouping your test cases together |
| SuiteDetailsLabel | Suite Details |
| SuiteEntryLabel | Suite {0}: {1} |
| SuiteHierarchyLabel | Suite Hierarchy |
| SuiteState_Completed | Completed |
| SuiteState_InPlanning | In planning |
| SuiteState_InProgress | In progress |
| SuiteState_None | None |
| TestAnalysisByTypeChartLabel | Test Analysis by Type |
| TestCaseLabel | Test Case |
| TestCasesLabel | Test Cases ({0}) |
| TestControllerLabel | Test controller: |
| TestEnvironmentLabel | Test environment: |
| TestOutcomeChartLabel | Test Outcome |
| TestPlanAvailableConfigsLabel | Available Configurations ({0}) |
| TestPlanLabel | Test plan |
| TestPlanSectionDescription | A test plan lets you specify what you want to test and how to run those tests. A test plan can be applied to a specific iteration of your project. You can have just one default test suite for your test cases |
| TestPlanSectionDescription2 | You can also select the default configurations to use to run the tests in your test plan. The test configuration informs the tester of the set up that is required for these tests. You can have one or multiple default configurations. A test result is recorded every time that you run the test with a specific configuration. A test plan enables you to measure your testing progress |
| TestPlanSectionText | Test Plan Details |
| TestPlanStatusLabel | Status: |
| TestPlanTestSettingsLabel | Test Settings |
| TestResolutionLabel | Test resolution: |
| TestRunDetails_BuildSummaryDisplay | {0} (Platform: {1} |
| TestRunLabel | Test Run |
| TestRunState_Aborted | aborted |
| TestRunState_Completed | completed |
| TestRunState_InProgress | in progress |
| TestRunState_NotStarted | not started |
| TestRunState_Waiting | waiting |
| TestRunSummaryHeader | {0} Test run{1} {2} |
| TestRunSummaryHeader_WithIssuesLabel | with issues |
| TestSettingsDetailsDescription | Test settings use diagnostic data adapters |
| TestSettingsDetailsHeaderLabel | Settings Details |
| TestSettingsLabel | Test settings: |
| TestStepsLabel | Test Steps ({0}) |
| TestSuiteState | State: |
| TimespanInProgress | in progress |
| TimespanLabel | Timespan: |
| TitleColumnHeader | Title |
| TitleHeaderColumnHeader | Title |
| TypeLabel | Type: |
| TypeNone | {0} None ({1}%) |
| UnanalyzedFailuresByOwnerChartLabel | Unanalyzed Failures by Owner |
| UnassignedFailureHeaderLabel | Unanalyzed Failures ({0}) |