<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Guoqiang Wu's Blog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/guowu/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/guowu/feed.xml</link>
    <description>Fun in the Office</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:10:22 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Fixing up InfoPath exported .mhts in Word</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/fixing-up-infopath-exported-mhts-in-word</link>
      <pubDate>Tue, 08 Nov 2005 13:35:09 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/11/08/fixing-up-infopath-exported-mhts-in-word/</guid>
      <description><![CDATA[If you export a complex InfoPath view to web archive (.mht) file then edit it in Word, you may...]]></description>
      <content:encoded><![CDATA[<p>If you export a complex InfoPath view to web archive (.mht) file then edit it in Word, you may notice that Word takes a long time to paginate the document when you switch to print layout for the first time. This is happening because the .mht file has a lot of tall and nested tables spanning across multiple pages and it is hard for Word to layout those tables on pages.
</p><p>So what can we do about it? Not much from InfoPath side, as most those tables are produced by InfoPath container controls such as repeating sections, lists, etc. However, from Word side, if you think about it, those tables do not serve as containers any more. And if they only have one column, they do not do what tables in Word suppose to do: layout things on pages. So we can just get rid of those (just the grid, we need keep the content of course). And that magic can be performed by the <a href="https://msdn.microsoft.com/library/en-us/vbawd11/html/womthConvertToText1_HV05210345.asp">ConvertToText method</a> of <a href="https://msdn.microsoft.com/library/en-us/vbawd11/html/woobjTable1_HV05213695.asp">Table</a> object, as shown below:
</p><p> 
 </p><div><table style="border-collapse:collapse" border="0"><colgroup><col style="width:541px"/></colgroup><tbody vAlign="top"><tr style="height: 185px"><td style="PADDING-LEFT: 7px; PADDING-RIGHT: 7px; BORDER-TOP:  solid #d6d4ca 0.5pt; BORDER-LEFT:  solid #d6d4ca 0.5pt; BORDER-BOTTOM:  solid #d6d4ca 0.5pt; BORDER-RIGHT:  solid #d6d4ca 0.5pt"><p><span style="font-family:Courier New; font-size:10"><span style="color:blue">Sub</span> UnNestTables()</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">Dim</span> tbP <span style="color:blue">As</span> Table</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">For Each</span> tbP <span style="color:blue">In</span> ActiveDocument.Tables</span>
						</p><p><span style="font-family:Courier New; font-size:10">       UnNestTable tbP</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">Next</span></span>
						</p><p><span style="color:blue; font-family:Courier New; font-size:10">End Sub</span>
						</p><p> 
 </p><p><span style="font-family:Courier New; font-size:10"><span style="color:blue">Sub</span> UnNestTable(tbl <span style="color:blue">As</span> Table)</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">Dim</span> tblChild <span style="color:blue">As</span> Table</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">For Each</span> tblChild <span style="color:blue">In</span> tbl.Tables</span>
						</p><p><span style="font-family:Courier New; font-size:10">        UnNestTable tblChild</span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">Next</span></span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">If</span> tbl.Columns.Count = 1 <span style="color:blue">Then</span></span>
						</p><p><span style="font-family:Courier New; font-size:10">        tbl.ConvertToText wdSeparateByParagraphs, <span style="color:blue">False</span></span>
						</p><p><span style="font-family:Courier New; font-size:10">    <span style="color:blue">End If</span></span>
						</p><p><span style="color:blue; font-family:Courier New; font-size:10">End Sub</span></p></td></tr></tbody></table></div><p> 
 </p><p>After running the "UnNestTables" macro above in Word, all one-column tables will be removed. You should no longer experience the performance lag mentioned above. In addition, you'd find the document looks much neater and easier to work with.</p>]]></content:encoded>
    </item>
    <item>
      <title>Handy-Dandy Scripts: closing Word gracefully</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/handy-dandy-scripts-closing-word-gracefully</link>
      <pubDate>Wed, 02 Nov 2005 17:53:13 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/11/02/handy-dandy-scripts-closing-word-gracefully/</guid>
      <description><![CDATA[Sometimes you may find winword.exe process lingering in the memeory and there is no visible Word...]]></description>
      <content:encoded><![CDATA[<div>Sometimes you may find winword.exe process lingering in the memeory and there is no visible Word window that allows you to close it. Believe me, this mostly likely is not Word's fault: chances are that those ghost Word instances are started by some third party applications via automation. But for some reason those applications are not able to terminte the Word instances they brought up. </div>
<div> </div>
<div>Now aside from blaming third party applications, what can you do to close Word gracefully? You certainly could kill the process from task manager or other process managing applications. But that is not something called "gracefully": for one thing setting changes you made to Word may get lost. Second if the killed Word instance has modified document open, you will be greeted by the "Document Recovery" taskpane next time you starts Word. </div>
<div> </div>
<div>In case you don't know, the trick is to use GetObject to connect to the existing Word Application COM object. Running a simple vbscript like the one below should do the job:</div>
<div> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font face="Courier New"><span style="FONT-SIZE: 10pt"><font color="#0000ff">On </font></span><span style="FONT-SIZE: 10pt"><font color="#0000ff">Error </font><font color="#0000ff">Resume </font><font color="#0000ff">Next</font></span></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font face="Courier New"><span style="FONT-SIZE: 10pt"><font color="#0000ff">Do</font></span><span style="FONT-SIZE: 10pt"></span></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">     <font color="#0000ff">Set</font> wd = <font color="#0000ff">Nothing</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">     <font color="#0000ff">Set</font> wd = GetObject(, <font color="#800000">"Word.Application"</font>)</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">     <font color="#0000ff">If Not</font> wd <font color="#0000ff">Is </font><font color="#0000ff">Nothing Then</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">          wd.Quit 0 <font color="#008000">'wdDoNotSaveChanges</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">     <font color="#0000ff">Else</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">          <font color="#0000ff">Exit </font><font color="#0000ff">Do</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; FONT-SIZE: 12pt; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span style="FONT-SIZE: 10pt"><font face="Courier New">     <font color="#0000ff">End</font><font color="#0000ff"> If</font></font></span></div>
<div style="BACKGROUND-COLOR: #f5f3eb"><font face="Courier New"><span style="FONT-SIZE: 10pt"><font face="Courier New" color="#0000ff">Loop</font></span></font></div>
<div> </div>
<div>Warning: the above script will force Word to quit without saving any changes. If you have unsaved but important changes pending in a "ghost" Word instance, you should use GetObject to connect to the instance first, then save your changes with Word object model.</div>
<div id="CSBloggerSig"></div>
]]></content:encoded>
    </item>
    <item>
      <title>CSBlogger updates</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/csblogger-updates</link>
      <pubDate>Wed, 20 Jul 2005 00:17:00 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/07/20/csblogger-updates/</guid>
      <description><![CDATA[Haven't touched it for quiet a while, tonight I suddenly feel motivated to fix a few old bugs...]]></description>
      <content:encoded><![CDATA[<DIV>Haven't touched it for quiet a while, tonight I suddenly feel motivated to fix a few old bugs on&nbsp;<a href="https://blogs.msdn.com/guowu/archive/2005/05/25/421975.aspx">CSBlogger</A>&nbsp;and the newest build is now available <A href="https://gqwu.members.winisp.net/blogeditor/">here</A>.</DIV>
<DIV>&nbsp;</DIV>
<DIV>
<TABLE class=msoUcTable style="TABLE-LAYOUT: fixed; WIDTH: 614px; BORDER-TOP-STYLE: none; BORDER-RIGHT-STYLE: none; BORDER-LEFT-STYLE: none; BORDER-COLLAPSE: collapse; WORD-WRAP: break-word; BORDER-BOTTOM-STYLE: none" tabIndex=-1 width="90%" border=1>
<COLGROUP>
<COL style="WIDTH: 89px">
<COL style="WIDTH: 417px">
<COL style="WIDTH: 108px"></COLGROUP>
<TBODY>
<TR style="MIN-HEIGHT: 26px">
<TD><FONT size=2><STRONG>Version</STRONG></FONT></TD>
<TD><FONT size=2><STRONG>Description</STRONG></FONT></TD>
<TD><FONT size=2>Credit</FONT></TD></TR>
<TR style="MIN-HEIGHT: 26px">
<TD><FONT size=2>1.1.0.38</FONT></TD>
<TD><U><FONT size=2>Bug fixes:</FONT></U><FONT size=2><BR>1) Error when retrieving post with an apostrophe(') in the title<BR>2) Error with SetNamedNodeProperty when retrieving posts<BR>3) Post content appears blank when opening the saved xml file</FONT></TD>
<TD><FONT size=2><A href="https://www.midwestcoders.net/blogs/craig_vermeer/">Craig</A> and <A href="https://www.tapmymind.com/blog/tap_my_mind/">Scott</A></FONT></TD></TR></TBODY></TABLE></DIV>
<DIV>&nbsp;</DIV>
<DIV>Besides the fixes I made, there may also be two behavior changes(good or bad)&nbsp;due to changes made&nbsp;on Community Server side(it seems like msdn is now running on CS 1.2):</DIV>
<DIV>a) The <a href="https://blogs.msdn.com/guowu/archive/2005/05/24/421614.aspx">GetRecentPosts API issue</A>&nbsp;is now fixed. </DIV>
<DIV>b) It seems a new bug is introduced with the EnableComments property: it is always set to false when post is retrieved from the server. When updating existing blog entries,&nbsp;please make sure "Enable comments" option is checked if you do want comments turned on.</DIV>
<DIV>&nbsp;</DIV>
<DIV>Special notice to Community Server 1.0 users:</DIV>
<DIV>Because Community Server 1.1 is now available publicly, I decide not to maintain a separate binary for Community Server 1.0 any more. However, you can always download the source code and compile it for Community Server 1.0 if necessary.</DIV>
<DIV id=CSBloggerSig></DIV>]]></content:encoded>
    </item>
    <item>
      <title>Uninstalling Office updates</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/uninstalling-office-updates</link>
      <pubDate>Tue, 12 Jul 2005 18:20:00 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/07/12/uninstalling-office-updates/</guid>
      <description><![CDATA[Office updates released after today (July 12th, 2005) may be uninstalled like most Windows updates...]]></description>
      <content:encoded><![CDATA[Office updates released after today (July 12th, 2005) may be uninstalled like most Windows updates if certain criteria is met. You can find more details in this KB article <a href="https://support.microsoft.com/kb/903771/">"Information about the ability to uninstall Office updates"</a>. And the very first honorable update that can be uninstalled is <font face="Verdana" size="2"><span style="FONT-SIZE: 10pt"><a title="https://www.microsoft.com/downloads/details.aspx?" familyid="A7E7D2C5-1E2A-4FFB-8FC2-B2B217015820&amp;amp;" displaylang="en" href="https://www.microsoft.com/downloads/details.aspx?FamilyId=A7E7D2C5-1E2A-4FFB-8FC2-B2B217015820&amp;amp;displaylang=en">Security Update for Word 2002 (KB895589)</a>.</span></font> 
<div id="CSBloggerSig"></div>]]></content:encoded>
    </item>
    <item>
      <title>Taking snapshots for part of a Word document - the new EnhMetaFileBits property</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/taking-snapshots-for-part-of-a-word-document-the-new-enhmetafilebits-property</link>
      <pubDate>Thu, 09 Jun 2005 12:25:13 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/06/09/taking-snapshots-for-part-of-a-word-document-the-new-enhmetafilebits-property/</guid>
      <description><![CDATA[In Word 2003 object model a new property named EnhMetaFileBits for Range and Selection object is...]]></description>
      <content:encoded><![CDATA[<div>In Word 2003 object model a new property named <a href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/vbawd11/html/woproEnhMetaFileBits_HV01033615.asp">EnhMetaFileBits</a> for <a href="https://msdn.microsoft.com/library/en-us/vbawd11/html/woobjRange1_HV05212781.asp">Range</a> and <a href="https://msdn.microsoft.com/library/en-us/vbawd11/html/woobjSelection1_HV05213190.asp">Selection</a> object is introduced. From the documentation, you'd see that it is supposed to help getting the picture representation for a portion of a Word document. Very interesting, isn't it? However the sample included with Word VBA help is too simple to make any real use of it. I searched the web a little and did not find anything helpful. So I decided to try it out myself to see how it works. And the result? Check out this nice little screenshot:</div>
<div> </div>
<div><img title="https://gqwu.members.winisp.net/blog/images/wd-emfbits.png" alt="EnhMetaFileBits test screenshot" src="https://gqwu.members.winisp.net/blog/images/wd-emfbits.png" /></div>
<div> </div>
<div>What I did was to create my favorite "rainbow" WordArt in Word, then use <strong>EnhMetaFileBits</strong> to get its EMF representation and draw that in the picture box on my windows form. The skeleton of my c# code is as following:</div>
<div> </div>
<div bgcolor="#00FF00"><div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font face="Courier New"><font style="FONT-SIZE: 9pt"><span><font style="FONT-SIZE: 9pt" color="#0000ff">using</font></span><span> Office = Microsoft.Office.Core;</span></font></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt"><span><font style="FONT-SIZE: 9pt" color="#0000ff">using</font></span><span> Word = Microsoft.Office.Interop.Word;</span></font></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">…</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt"><span><font style="FONT-SIZE: 9pt" color="#0000ff">object</font></span><span> missing = System.Reflection.Missing.Value;</span></font></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Get the Graphics object from the picture box</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">Graphics g = pictureBox1.CreateGraphics();</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Clear the picture box</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">g.Clear(pictureBox1.BackColor);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">g.DrawString("Starting Microsoft Word, please wait...",<font style="FONT-SIZE: 9pt" color="#0000ff">this</font>.Font,<font style="FONT-SIZE: 9pt" color="#0000ff">new</font> SolidBrush(Color.Black),<font style="FONT-SIZE: 9pt" color="#0000ff">new</font> PointF(0F,0F));</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Start a new Word instance if necessary</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt"><span><font style="FONT-SIZE: 9pt" color="#0000ff">if</font></span><span> (wdApp == <font style="FONT-SIZE: 9pt" color="#0000ff">null</font>)</span></font></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">wdApp = <font style="FONT-SIZE: 9pt" color="#0000ff">new</font> Word.ApplicationClass();</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Create a new document</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">Word.Document wdDoc = wdApp.Documents.Add(<font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing, <font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing, <font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing, <font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Add a WordArt with text from textBox1 to the new document</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">Word.Shape wdShape = wdDoc.Shapes.AddTextEffect(</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt">    Office.MsoPresetTextEffect.msoTextEffect16, <font style="FONT-SIZE: 9pt" color="#008000">//the rainbow wordart</font></font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt"><font style="FONT-SIZE: 9pt" color="#0000ff">    this</font>.textBox1.Text, "Arial Black", 16,</font></font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">    Office.MsoTriState.msoFalse, Office.MsoTriState.msoFalse,</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">    0, 0, <font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Select the shape so that EnhMetaFileBits can be retrieved from the Selection object</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// This is unnecessary if you have a Range object handy</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">wdShape.Select(<font style="FONT-SIZE: 9pt" color="#0000ff">ref</font> missing);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Create a meta file using the byte array returned from EnhMetaFileBits</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><font style="FONT-SIZE: 9pt" face="Courier New"><font style="FONT-SIZE: 9pt"><span><font style="FONT-SIZE: 9pt" color="#0000ff">byte</font></span><span>[] emfData = (<font style="FONT-SIZE: 9pt" color="#0000ff">byte</font>[])wdApp.Selection.EnhMetaFileBits;</span></font></font></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">System.IO.MemoryStream ms = <font style="FONT-SIZE: 9pt" color="#0000ff">new</font> System.IO.MemoryStream(emfData);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">Metafile mf = <font style="FONT-SIZE: 9pt" color="#0000ff">new</font> Metafile(ms);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New"></font></span> </div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New" color="#008000">// Draw the meta file in the picture box</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">g.Clear(pictureBox1.BackColor);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">g.DrawImageUnscaled(mf, 0, 0);</font></span></div>
<div style="PADDING-RIGHT: 0in; MARGIN-TOP: 0in; PADDING-LEFT: 0in; MARGIN-BOTTOM: 0pt; BACKGROUND-COLOR: #f5f3eb"><span><font style="FONT-SIZE: 9pt" face="Courier New">g.Dispose();</font></span></div>
</div>
<div> </div>
<div>As you can see it is pretty easy and straigtforward. However, there is one caveat: the <strong>Metafile</strong> object created this way may be much wider than it should be: a very big extra white margin may appear to the right. That is why I am using the <strong>DrawImageUnscaled</strong> method to crop the image. I am still trying to figure out the cause. It might be something I did wrong because I know very little about <strong>System.Drawing</strong> namespace. Any GDI experts out there care to comment?</div>
<div> </div>
<div>The sample VS.Net 2003 solution is available for download <a href="https://gqwu.members.winisp.net/blog/files/wd-emfbits.zip">here</a>.</div>
<div id="CSBloggerSig"></div>
]]></content:encoded>
    </item>
    <item>
      <title>RSS feeds for KB articles</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/rss-feeds-for-kb-articles</link>
      <pubDate>Thu, 26 May 2005 19:54:00 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/05/26/rss-feeds-for-kb-articles/</guid>
      <description><![CDATA[Normally I don't point people around. This one is too good to miss though: Microsoft is introducing...]]></description>
      <content:encoded><![CDATA[<div id="CSBlogger">Normally I don't point people around. This one is too good to miss though: Microsoft is introducing <a href="https://support.microsoft.com/selectindex/?target=rss">RSS feeds</a> that list the most recently published KB articles for many products. </div>
<div> </div>
<div>[Update] - I took the time to create the OPML so that you don't need to copy/paste the feeds into your news reader. You can get it <a href="https://gqwu.members.winisp.net/blog/files/mskbs.opml.xml">here</a>.</div>
<div id="CSBloggerSig"></div>]]></content:encoded>
    </item>
    <item>
      <title>Authoring XML schema (XSD) with InfoPath - Part II</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/authoring-xml-schema-xsd-with-infopath-part-ii</link>
      <pubDate>Thu, 26 May 2005 19:10:23 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/05/26/authoring-xml-schema-xsd-with-infopath-part-ii/</guid>
      <description><![CDATA[Like I mentioned earlier, it is very easy to use InfoPath as an XML schema editor, with very little...]]></description>
      <content:encoded><![CDATA[<div>Like I mentioned <a href="https://blogs.msdn.com/guowu/archive/2005/05/24/421588.aspx">earlier</a>, it is very easy to use InfoPath as an XML schema editor, with very little extra work:</div>


<div> </div>


<ol style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" type="1"><li>Choose <strong>Design a form…</strong> from the <strong>File </strong>Menu in InfoPath.
</li><li>In the <strong>Design a new form</strong> task pane, select <strong>New Blank Form</strong>. Note, if you want to derive a schema from existing XML document or data connection, choose one of the <strong>New from</strong>… options and skip to step 4) below.
</li><li>On the <strong>Design Tasks</strong> pane, click on <strong>Data Source</strong> to show the Data Source Pane. Right click on the <strong>myFields</strong> element, you will see a shortcut menu. Starting there, you can create data source structure that models your need.
</li><li>Once you are done, go to <strong>File</strong> menu, <strong>Extract form files…</strong>, then quit InfoPath. Go to the folder you just saved extracted form files, you should find <strong>myschema.xsd</strong> is what you want. Note: if you are deriving a schema, the schema you want may not be defined directly inside <strong>myschema.xsd</strong>, but imported there.</li><li>(Optional) Open <strong>myschema.xsd</strong> in your favorite XML or text editor, remove the <strong>my</strong> namespace auto-generated by InfoPath or replace it with your desired namespace URI.</li></ol><div> </div>


<div>And that is it!</div>


<div id="CSBloggerSig"><div><hr tabIndex="-1" /></div>


<div align="right"><div>Have a nice day and thanks for listening to me murmuring!</div>


</div>


</div>


]]></content:encoded>
    </item>
    <item>
      <title>CSBlogger 1.1 is released!</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/csblogger-1-1-is-released</link>
      <pubDate>Wed, 25 May 2005 22:58:12 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/05/25/csblogger-1-1-is-released/</guid>
      <description><![CDATA[Available now here. I am little bit surprised that CSBlogger didn't get much attention as its .Text...]]></description>
      <content:encoded><![CDATA[<div>Available now <a href="https://gqwu.members.winisp.net/blogeditor/">here</a>. I am little bit surprised that CSBlogger didn't get much attention as its .Text cousin <a href="https://blogs.msdn.com/guowu/archive/2004/07/20/187990.aspx">SimpleBlogger </a>had. So I decide to list a few reasons why you should consider using CSBlogger  as your Community Server blog editor:</div>

<div> </div>

<div>1) It provides features that are standard in Microsoft Office application, but not available in most blog clients, including: format painter, undo/redo, spell checker, auto-correction, etc.;</div>

<div>2) It has full offline support, which means you can blog on the go;</div>

<div>3) It has the nice look and feel of web pages, and good user experience of standalone windows application. Personally I think it is pretty cool. Take a look at <a href="https://gqwu.members.winisp.net/blogeditor/screenshots.htm">screenshots</a>, and see whether you disagree with me.</div>

<div>4) The "Insert Picture" and "Paste Html" issue in SimpleBlogger has been workaround in the latest release;</div>

<div>5) Oh, the new release allows you specify a signature for your blogs, like the one you see at the end of this post;</div>

<div>...</div>

<div> </div>

<div>Ok, better stop now. Also stopped should be updates on CSBlogger releases. Now that everything I want it to do is in place, I think I can get some rest now. But, if you find any bugs, please let me know.</div>

<div id="CSBloggerSig"><hr tabIndex="-1" /><div align="right">Have a nice day and thanks for listening to me murmuring!</div>

</div>

]]></content:encoded>
    </item>
    <item>
      <title>Community Server Issues - Part II</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/community-server-issues-part-ii</link>
      <pubDate>Tue, 24 May 2005 22:35:17 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/05/24/community-server-issues-part-ii/</guid>
      <description><![CDATA[A while back, I complained about the big pain caused by the SOAP header change between Community...]]></description>
      <content:encoded><![CDATA[<div>A while <a href="https://blogs.msdn.com/guowu/archive/2005/05/13/417134.aspx">back</a>, I complained about the big pain caused by the SOAP header change between Community Server 1.0 and 1.1 web service APIs. Scott was kind enough to explain why they made the change. Still, getting my blog editor to work with both versions is painful. At first I went for the easy route and created separate editions for each version. It turned out to be very silly and annoying to maintain two almost identical copies of the code. So I decided to bite the bullet and use conditional compilation to merge the code together. The process was smooth but tedious; those "#if…#else…#endif" clauses scattered everywhere really do not look pretty. After all, it worked fine and now I have one code base to work with. You will see the combined source code uploaded a few days after I am done with a major update on <a href="https://gqwu.members.winisp.net/blogeditor/">CSBlogger</a>. Stay tuned if you are interested.</div>

<div> </div>

<div>Anyway, back to the topic. At the time I posted the first one, the next issue I planned to talk about was that Community Server strips out all style formatting in blog entries. That, after a few weeks, seems to me not as bad as it originally appeared. I guess the point is that blogging is not web publishing and bloggers should try to keep their posts clean and plain. I don't necessarily agree with this but can live with it. Just that tables in my old posts now look so horrible that I had to change the custom CSS for my blog to make them at least look ok.</div>

<div> </div>

<div>That leaves me with two remaining issues. Both on the blogservice web service API of Community Server:</div>

<ul style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px" type="disc"><li>the GetRecentPosts API turns out to be "GetOldPosts": it always return the oldest n posts if given n as the number of posts to retrieve from the server. This would make my blog editor too hard to use for those long time bloggers because they will have to retrieve all their blog entries to get the latest one. I don't know whether this happens also with the GetRecentArticles API;</li><li>the value of the Date field in a BlogPost is off several hours even though I had set the time zone in my user options. To workaround this, I had to manually add/substract a certain value to the date.</li></ul><div> </div>

<div>I hope those two are not my mistakes. :-) That is all I have in mind for now. Next time I will post some suggestions and feature requests on the web service APIs.</div>

<div> </div>

<div>[Update] Just found one more issue: the "IsPublished" value of a BlogPost is always true when calling GetRecentPosts.</div>

<div id="CSBloggerSig"><hr tabIndex="-1" /><div align="right">Have a nice day and thanks for listening to me murmuring!</div>

</div>

]]></content:encoded>
    </item>
    <item>
      <title>Authoring XML schema (XSD) with InfoPath - Part I</title>
      <link>https://docs.microsoft.com/archive/blogs/guowu/authoring-xml-schema-xsd-with-infopath-part-i</link>
      <pubDate>Tue, 24 May 2005 19:51:37 GMT</pubDate>
      <dc:creator><![CDATA[guowu]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/guowu/2005/05/24/authoring-xml-schema-xsd-with-infopath-part-i/</guid>
      <description><![CDATA[Recently, I ran across Aaron Skonnard's MSDN magazine articles talking about Contract First Service...]]></description>
      <content:encoded><![CDATA[<div id="CSBlogger">Recently, I ran across <a href="https://msdn.microsoft.com/msdnmag/issues/05/06/ServiceStation/default.aspx">Aaron Skonnard's MSDN magazine articles talking about Contract First Service Development</a>. The very first step of this so called "Contract-First" development process is to create the XML schema. And for that, Aaron recommended Visual Studio as one of the XSD editor. This reminds me to mention a frequently overlooked fact that Microsoft InfoPath actually works great as an XSD authoring tool. </div>


<div> </div>


<div>The biggest advantage of using InfoPath as an XSD editor is, IMHO, the WYSIWYG user interface: </div>


<div> <img title="https://gqwu.members.winisp.net/blog/images/ipxsd-0.png" style="FLOAT: none; WIDTH: 246px; HEIGHT: 536px" tabIndex="-1" alt="" src="https://gqwu.members.winisp.net/blog/images/ipxsd-0.png" /></div>


<div>As the screenshot above shows, you can create, modify and visualize your data structure very easily. It will be a tremendous help if you are not so familiar with XML schema.</div>


<div> </div>


<div>The other big, big plus is that InfoPath can derive XML schema for you: provide an xml file, a web service (well, I know this is a little bit redundant, just for the record), or even a <strong>database connection</strong>, and you are all set!</div>


<div> </div>


<div>I hope that is enough to get you interested. Before we move on and talk about how to use InfoPath to create XML schemas, you should also be aware of the con's:</div>


<div>1) This is not an intended functionality of InfoPath. So you will have to do a little extra (very little, I promise) work.</div>


<div>2) Some XSD constructs are not supported by InfoPath. See details in this MSDN article: <a href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFInfoPathXSD.asp">https://msdn.microsoft.com/library/default.asp?url=/library/en-us/odc_ip2003_ta/html/ODC_INFInfoPathXSD.asp</a></div>


<div> </div>


<div>Ok, next post I will talk in details about how to do this. While on the topic, I'd point out that InfoPath is also great for XSL editing because of the WYSIWYG UI. You will have to clean up all those InfoPath specific styles definition though. My other favorite XSL editor is Microsoft FrontPage 2003: its intellisence extension for XSL is a huge relief, not to mention you also get a rich set of XML editing features.</div>


<div id="CSBloggerSig"></div>


]]></content:encoded>
    </item>
  </channel>
</rss>