title: Accessing other Document fields with Coded UI Word Add-In
body: <p>I'm using the ALM Rangers Coded UI Word Add-in from <a href="http://vsarcodeduiword.codeplex.com/" rel="nofollow">http://vsarcodeduiword.codeplex.com/</a> and I would like to be able to make assertions on the code of fields in a selection of text.</p>
  
  <p>I can make assertions on the text selected, which is represented by a UITestControl object.  The problem is that the properties supported by the Coded UI Word Add-in are limited.  Since it's open source I tried adding support for the Fields property myself (I believe the selected text is a Word.Range object)</p>
  
  <p>I added the following line of code to the GetSelectionProperty in UITestCommunicator.cs in the WordAddIn project in the add-in mentioned above:
      case PropertyNames.Fields: return selection.Fields;</p>
  
  <p>The problem is that when I try to access that property, the test fails with the error posted below.  Is there another way to add support, or</p>
  
  <p>Test method CuiAutoTagTagTestProject.CuiAutoTagTagTests.InsertOutTag threw exception: System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.Assembly manager loaded from:  C:\Windows\Microsoft.NET\Framework64\v4.0.30319\clr.dllRunning under executable  C:\Program Files\Microsoft Office\Office14\WINWORD.EXE--- A detailed error log follows. 
  === Pre-bind state information ===LOG: User = WINDWARD\marcusjLOG: DisplayName = Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)LOG: Appbase = file:///C:/Users/marcusj/AppData/Roaming/Microsoft Visual Studio ALM Rangers/Coded UI Word 2010 Add-in/LOG: Initial PrivatePath = NULLCalling assembly : (Unknown).===LOG: This bind starts in default load context.LOG: No application configuration file found.LOG: Using host configuration file: LOG: Using machine configuration file from C:\Windows\Microsoft.NET\Framework64\v4.0.30319\config\machine.config.LOG: Post-policy reference: Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3aLOG: Attempting download of new URL file:///C:/Users/marcusj/AppData/Roaming/Microsoft Visual Studio ALM Rangers/Coded UI Word 2010 Add-in/Microsoft.VisualStudio.TestTools.UITest.Extension.DLL.LOG: Attempting download of new URL file:///C:/Users/marcusj/AppData/Roaming/Microsoft Visual Studio ALM Rangers/Coded UI Word 2010 Add-in/Microsoft.VisualStudio.TestTools.UITest.Extension/Microsoft.VisualStudio.TestTools.UITest.Extension.DLL.LOG: Attempting download of new URL file:///C:/Users/marcusj/AppData/Roaming/Microsoft Visual Studio ALM Rangers/Coded UI Word 2010 Add-in/Microsoft.VisualStudio.TestTools.UITest.Extension.EXE.LOG: Attempting download of new URL file:///C:/Users/marcusj/AppData/Roaming/Microsoft Visual Studio ALM Rangers/Coded UI Word 2010 Add-in/Microsoft.VisualStudio.TestTools.UITest.Extension/Microsoft.VisualStudio.TestTools.UITest.Extension.EXE.</p>