<?xml version="1.0" encoding="UTF-8" ?>
<?xml-stylesheet type="text/xsl" href="http://blogs.msdn.com/utility/FeedStylesheets/rss.xsl" media="screen"?><rss version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:wfw="http://wellformedweb.org/CommentAPI/"><channel><title>Office Development with Visual Studio : Dialog boxes</title><link>http://blogs.msdn.com/vsto/archive/tags/Dialog+boxes/default.aspx</link><description>Tags: Dialog boxes</description><dc:language>en-US</dc:language><generator>CommunityServer 2.1 SP1 (Build: 61025.2)</generator><item><title>Test Automation Tips: “User Name” dialog after new install of Word (Christin Boyd, Bill Robertson)</title><link>http://blogs.msdn.com/vsto/archive/2009/05/05/test-automation-tips-user-name-dialog-after-new-install-of-word-christin-boyd-bill-robertson.aspx</link><pubDate>Wed, 06 May 2009 00:12:12 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:9589711</guid><dc:creator>VSTO Team</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vsto/comments/9589711.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=9589711</wfw:commentRss><description>&lt;p&gt;We have a team of developers who focus entirely on writing test automation programs for the purpose of covering the huge matrix of test cases that Visual Studio requires.&amp;#160; We often configure new installs of Office and our automated tests need to deal with the special things that Office products do when you first run them after a new install.&amp;#160; For example, when you first run Microsoft Word after a new install, it prompts you to enter your name and initials in a dialog that looks like this:&lt;/p&gt;  &lt;p&gt;&lt;a href="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/TestAutomationTipsUserNamedialogafternew_ABB4/clip_image002_2.jpg"&gt;&lt;img title="clip_image002" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="107" alt="clip_image002" src="http://blogs.msdn.com/blogfiles/vsto/WindowsLiveWriter/TestAutomationTipsUserNamedialogafternew_ABB4/clip_image002_thumb.jpg" width="244" border="0" /&gt;&lt;/a&gt;&lt;/p&gt;  &lt;p&gt;Our talented SDET’s (Software Development Engineer in Test) use the following function in their automated tests to suppress this dialog:&lt;/p&gt;  &lt;div id="codeSnippetWrapper"&gt;   &lt;div id="codeSnippet" style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;     &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.IO;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;using&lt;/span&gt; System.Diagnostics;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; AddOffice12UserInfo()&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; passed = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[] commands = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; &lt;span style="color: #0000ff"&gt;string&lt;/span&gt;[5];&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            commands[0] = &lt;span style="color: #006080"&gt;@&amp;quot;add HKCU\Software\Microsoft\Office\12.0\Common /v UserData /t REG_DWORD /d 1 /f&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            commands[1] = &lt;span style="color: #006080"&gt;@&amp;quot;add HKCU\Software\Microsoft\Office\Common\UserInfo /v Company /t REG_SZ /d Microsoft /f&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            commands[2] = &lt;span style="color: #006080"&gt;@&amp;quot;add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserName /t REG_SZ /d TestRun /f&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            commands[3] = &lt;span style="color: #006080"&gt;@&amp;quot;add HKCU\Software\Microsoft\Office\Common\UserInfo /v UserInitials /t REG_SZ /d t /f&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            commands[4] = &lt;span style="color: #006080"&gt;@&amp;quot;add HKCU\Software\Microsoft\Office\12.0\Common\General /v ShownOptIn /t REG_DWORD /d 00000001 /f&amp;quot;&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;for&lt;/span&gt; (&lt;span style="color: #0000ff"&gt;int&lt;/span&gt; i = 0; i &amp;lt; commands.Length; i++)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; temp = StartREG(commands[i]);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;                &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (!temp)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;                {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;                    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;                }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            passed = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; passed;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt; &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;&lt;span style="color: #0000ff"&gt;public&lt;/span&gt; &lt;span style="color: #0000ff"&gt;static&lt;/span&gt; &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; StartREG(&lt;span style="color: #0000ff"&gt;string&lt;/span&gt; arguments)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;{&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;bool&lt;/span&gt; passed = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;int&lt;/span&gt; exitcode = -100;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;try&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    {                &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;string&lt;/span&gt; localpath = Path.Combine(System.Environment.GetEnvironmentVariable(&lt;span style="color: #006080"&gt;&amp;quot;SYSTEMROOT&amp;quot;&lt;/span&gt;), &lt;span style="color: #006080"&gt;&amp;quot;system32&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        System.Diagnostics.Process myProcess = &lt;span style="color: #0000ff"&gt;new&lt;/span&gt; System.Diagnostics.Process();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        myProcess.EnableRaisingEvents = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        myProcess.StartInfo.FileName = Path.Combine(localpath, &lt;span style="color: #006080"&gt;&amp;quot;reg.exe&amp;quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        myProcess.StartInfo.Arguments = arguments;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        myProcess.StartInfo.UseShellExecute = &lt;span style="color: #0000ff"&gt;false&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        myProcess.Start();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        myProcess.WaitForExit();&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        exitcode = myProcess.ExitCode;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;if&lt;/span&gt; (exitcode == 0)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            passed = &lt;span style="color: #0000ff"&gt;true&lt;/span&gt;;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        &lt;span style="color: #0000ff"&gt;else&lt;/span&gt;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;        {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;            &lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;            Debug.WriteLine(&lt;span style="color: #006080"&gt;&amp;quot;reg exit code is::&amp;quot;&lt;/span&gt; + myProcess.ExitCode.ToString());&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;catch&lt;/span&gt; (Exception ex)&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    {&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;        Debug.Fail(ex.Message, ex.StackTrace);&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;    }&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: #f4f4f4; text-align: left; border-bottom-style: none"&gt;    &lt;span style="color: #0000ff"&gt;return&lt;/span&gt; passed;&lt;/pre&gt;
&lt;!--CRLF--&gt;

    &lt;pre style="padding-right: 0px; padding-left: 0px; font-size: 8pt; padding-bottom: 0px; margin: 0em; overflow: visible; width: 100%; color: black; direction: ltr; border-top-style: none; line-height: 12pt; padding-top: 0px; font-family: &amp;#39;Courier New&amp;#39;, courier, monospace; border-right-style: none; border-left-style: none; background-color: white; text-align: left; border-bottom-style: none"&gt;}&lt;/pre&gt;
&lt;!--CRLF--&gt;&lt;/div&gt;
&lt;/div&gt;

&lt;p&gt;Let me know if these Test Automation samples are useful and we will try to publish more of these.&lt;/p&gt;

&lt;p&gt;-Christin Boyd, Program Manager, Visual Studio and Bill Robertson, Software Development Engineer in Test, Visual Studio&lt;/p&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=9589711" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/VSTO/default.aspx">VSTO</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Christin+Boyd/default.aspx">Christin Boyd</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Dialog+boxes/default.aspx">Dialog boxes</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+2007/default.aspx">Word 2007</category><category domain="http://blogs.msdn.com/vsto/archive/tags/C_2300_/default.aspx">C#</category><category domain="http://blogs.msdn.com/vsto/archive/tags/sample/default.aspx">sample</category></item><item><title>Word Object Model: Getting Information from Word Dialogs (McLean Schofield)</title><link>http://blogs.msdn.com/vsto/archive/2008/02/19/word-object-model-getting-information-from-word-dialogs.aspx</link><pubDate>Wed, 20 Feb 2008 03:03:00 GMT</pubDate><guid isPermaLink="false">91d46819-8472-40ad-a661-2c78acb4018c:7805848</guid><dc:creator>VSTO Team</dc:creator><slash:comments>2</slash:comments><comments>http://blogs.msdn.com/vsto/comments/7805848.aspx</comments><wfw:commentRss>http://blogs.msdn.com/vsto/commentrss.aspx?PostID=7805848</wfw:commentRss><description>&lt;P&gt;Although VSTO provides many features that help simplify Office development (especially UI development), nearly every VSTO solution needs to dip into the underlying Office object model to get some work done. Because information about using the Office object models can be spread out in many different places, I thought it might help some readers who are just getting started with Office development using VSTO to talk about a Word object model question that came across my desk recently. 
&lt;P&gt;A developer on an internal alias inside Microsoft asked about the best way to programmatically show the &lt;STRONG&gt;Insert Picture&lt;/STRONG&gt; dialog box in a Word add-in, and how to perform some logic based upon the full name of the picture that the user selects. The developer had no trouble displaying this dialog box, but couldn't figure out how to get the file name of the chosen picture. 
&lt;P&gt;As the developer noticed, displaying the Insert Picture dialog box (or any built-in Word dialog box, for that matter), is pretty straightforward. The trickiest part is determining which WdWordDialog enum value to pass as an index to the ThisAddIn.Application.Dialogs property in the VSTO project. By referring to the VBA documentation for the WdWordDialog enum at &lt;U&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/bb214033.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb214033.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb214033.aspx&lt;/A&gt;&lt;/U&gt; and scanning through the list of values for something that matches the name of the Insert Picture dialog box, you will eventually find the value wdDialogInsertPicture. 
&lt;P&gt;So, the code to display this dialog box looks like: 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'VB&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim dialogBox As Word.Dialog = Globals.ThisAddIn.Application.Dialogs(Word.WdWordDialog.wdDialogInsertPicture)&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dialogBox.Show()&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // C#&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word.Dialog dialogBox = Globals.ThisAddIn.Application.Dialogs[Word.WdWordDialog.wdDialogInsertPicture];&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; dialogBox.Show();&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&lt;/FONT&gt;&lt;/P&gt;Now comes the hard part: how to use the Dialog object to get or set data contained in the corresponding dialog box. For example, when the end user uses the Insert Picture dialog box to select a picture file, how can I programmatically determine which file they selected? 
&lt;P&gt;The Dialog object (reference topic at &lt;A href="http://msdn2.microsoft.com/en-us/library/bb211882.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb211882.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb211882.aspx&lt;/A&gt;) doesn't provide much help. A quick look through its members doesn't show anything obviously useful or pertinent, like a "FileName" property anything like that. However, the reference topic for the WdWordDialog enum (&lt;U&gt;&lt;A href="http://msdn2.microsoft.com/en-us/library/bb214033.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb214033.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb214033.aspx&lt;/A&gt;&lt;/U&gt;) says something interesting (emphasis mine): 
&lt;P&gt;"Indicates the Microsoft Office Word dialog boxes with which you can work &lt;EM&gt;and specifies arguments, if applicable, that you can use to get or set values in a dialog box&lt;/EM&gt;." 
&lt;P&gt;This helps. So, for each WdWordDialog enum value, the table in this topic specifies the properties you can use to get or set information in the dialog box. For wdDialogInsertPicture, there are Name, LinkToFile, New, and FloatOverText properties. Of these, Name looks the most promising. So, how do we use the Name property if the Dialog class doesn't have this property? 
&lt;P&gt;The answer, as is often the case when using the Office object models, is late binding. The Name property is accessible only as a late-bound property, so the way that you use it in a VSTO project depends on the type of project you are developing: 
&lt;UL&gt;
&lt;LI&gt;You are using Visual Basic with Option Strict set to Off. 
&lt;LI&gt;You are using C# or Visual Basic with Option Strict set to On.&lt;/LI&gt;&lt;/UL&gt;
&lt;P&gt;If you're using VB with Option Strict set to Off, then you can use the following relatively simple code, which relies on late binding to access the Name property on the Dialog object at run time. After the Insert Picture dialog box is displayed, if the user selects a picture file and clicks Insert, then this code gets the full path of the selected file and displays the path in a message box: 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; 'VB&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Dim DialogResultOK As Integer = -1&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; With Globals.ThisAddIn.Application.Dialogs(Word.WdWordDialog.wdDialogInsertPicture)&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Courier size=2&gt;If .Show() = DialogResultOK Then&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.MessageBox.Show("The name of the inserted picture is: " &amp;amp; .Name)&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Courier size=2&gt;End If&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;/FONT&gt;&lt;FONT face=Courier size=2&gt;End With&lt;/FONT&gt; 
&lt;P&gt;If you're using C# or Visual Basic with Option Strict set to On, you'll have use reflection: 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; // C#&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; Word.Dialog dialogBox = Globals.ThisAddIn.Application.Dialogs[Word.WdWordDialog.wdDialogInsertPicture];&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Type dialogType = typeof(Word.Dialog);&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;int DialogResultOK = -1;&lt;/FONT&gt;&amp;nbsp; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; if (dialogBox.Show(ref missing) == DialogResultOK)&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; {&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; string pictureName = (string)dialogType.InvokeMember("Name", System.Reflection.BindingFlags.GetProperty | &lt;/FONT&gt;
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Reflection.BindingFlags.Public | System.Reflection.BindingFlags.Instance, null, dialogBox, null);&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; System.Windows.Forms.MessageBox.Show("The name of the inserted picture is: " + pictureName);&lt;/FONT&gt; 
&lt;P&gt;&lt;FONT face=Courier size=2&gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/FONT&gt; 
&lt;P&gt;This is one of those areas where the late-bound features of Visual Basic help make it a natural fit for Office programming. Granted, anything you can do in Visual Basic in terms of Office development is possible in C#, but it just isn't always as straightforward or elegant. 
&lt;P&gt;Some of you reading this might be wondering if they have to go digging around in the VBA reference documentation every time they need to figure out how to do something with the Office object models in VSTO. Not always - the VSTO documentation provides a set of "how to" topics with code examples for some of the most common programming tasks using the Excel and Word object models (see the topics under &lt;A title=http://msdn2.microsoft.com/en-us/library/kw65a0we.aspx href="http://msdn2.microsoft.com/en-us/library/kw65a0we.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/kw65a0we.aspx"&gt;http://msdn2.microsoft.com/en-us/library/kw65a0we.aspx&lt;/A&gt; for Word and &lt;A title=http://msdn2.microsoft.com/en-us/library/bb386293.aspx href="http://msdn2.microsoft.com/en-us/library/bb386293.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/bb386293.aspx"&gt;http://msdn2.microsoft.com/en-us/library/bb386293.aspx&lt;/A&gt; for Excel). In fact, most of the information in this post is covered in the topic "How to: Use Built-In Dialog Boxes in Word" at &lt;A title=http://msdn2.microsoft.com/en-us/library/ahzbkf8e.aspx href="http://msdn2.microsoft.com/en-us/library/ahzbkf8e.aspx" mce_href="http://msdn2.microsoft.com/en-us/library/ahzbkf8e.aspx"&gt;http://msdn2.microsoft.com/en-us/library/ahzbkf8e.aspx&lt;/A&gt;.&lt;/P&gt;&lt;img src="http://blogs.msdn.com/aggbug.aspx?PostID=7805848" width="1" height="1"&gt;</description><category domain="http://blogs.msdn.com/vsto/archive/tags/Word+Object+Model/default.aspx">Word Object Model</category><category domain="http://blogs.msdn.com/vsto/archive/tags/Dialog+boxes/default.aspx">Dialog boxes</category><category domain="http://blogs.msdn.com/vsto/archive/tags/McLean+Schofield/default.aspx">McLean Schofield</category></item></channel></rss>