<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0"
    xmlns:dc="http://purl.org/dc/elements/1.1/"
     xmlns:admin="http://webns.net/mvcb/"
     xmlns:content="http://purl.org/rss/1.0/modules/content/"
     xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#">
	<channel> 

	<title>Comments on: Find, Copy and Paste a Paragraph into a new Word Document</title>
	<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document/</link>
	<description>Comments on Ask MetaFilter post Find, Copy and Paste a Paragraph into a new Word Document</description>
	<pubDate>Thu, 22 Feb 2007 08:29:57 -0800</pubDate>
	<lastBuildDate>Thu, 22 Feb 2007 08:29:57 -0800</lastBuildDate>
	<language>en-us</language>
	<docs>http://blogs.law.harvard.edu/tech/rss</docs>
	<ttl>60</ttl>

	<item>
		<title>Question: Find, Copy and Paste a Paragraph into a new Word Document</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document</link>	
		<description>Is there a way to automatically find, copy, and paste an entire paragraph into a separate document in Microsoft Word based on just the beginning of the paragraph?  &lt;br /&gt;&lt;br /&gt; What I want to do is create a Word document that contains only paragraphs that contain a starting term, say &quot;MN:&quot;, from another Word document. I want to be able to do this automatically. Is there a way to do this?</description>
		<guid isPermaLink="false">post:ask.metafilter.com,2007:site.57463</guid>
		<pubDate>Thu, 22 Feb 2007 08:22:26 -0800</pubDate>
		<dc:creator>Jeff_Larson</dc:creator>
		
			<category>Microsoft</category>
		
			<category>Word</category>
		
			<category>Paragraph</category>
		
			<category>findcopyandpaste</category>
		
	</item> <item>
		<title>By: waxbanks</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864069</link>	
		<description>Word allows you to search within a document for things like carriage returns, and supports regular expression searching, so you should be able to create a macro that grabs everything between the starting and the next carriage return (something like ^n or ^p in Word&apos;s hidden-character lingo), and pastes it into the appropriate place.&lt;br&gt;
&lt;br&gt;
i.e. The answer to your question is surely &lt;em&gt;yes&lt;/em&gt;, and a little bit of fiddling around should turn up the method. Sorry I can&apos;t be more specifically helpful...</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864069</guid>
		<pubDate>Thu, 22 Feb 2007 08:29:57 -0800</pubDate>
		<dc:creator>waxbanks</dc:creator>
	</item><item>
		<title>By: waxbanks</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864094</link>	
		<description>A bit of googling around suggests the following procedure:&lt;br&gt;
&lt;br&gt;
Turn on wildcards in the &apos;Find&apos; box. Choose &apos;Highlight all occurrences in the main document&apos;. Search on (for instance):&lt;br&gt;
&lt;br&gt;
MN:*^13&lt;br&gt;
&lt;br&gt;
(^13 is the code for end-of-paragraph when wildcards are turned on; in normal searches you can just type in ^p.)&lt;br&gt;
&lt;br&gt;
You should end up with a bunch of paragraphs highlighted. Copy, then paste into another document. Dunno if that&apos;s sufficiently programmatic but it&apos;s a start in any case, I suppose. Note: on my Mac, this ^13 code doesn&apos;t seem to work properly. But the LazyWeb insists that it should work on Windows.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864094</guid>
		<pubDate>Thu, 22 Feb 2007 08:55:07 -0800</pubDate>
		<dc:creator>waxbanks</dc:creator>
	</item><item>
		<title>By: disillusioned</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864102</link>	
		<description>Just so you&apos;re aware, regular expressions are not for the faint of heart. They&apos;re not &lt;em&gt;obscenely&lt;/em&gt; difficult, but if you&apos;re not a programmer, you will look at a regex string like &lt; ([dm][rs]{1,2})( ) and probably throw up in your mouth a little bit. (finds patterns of mr, ms, mrs, and dr without periods, btw.)br&gt;
&lt;br&gt;
Pasting things into an entirely separate document is likely the purview of a macro, which I cannot help you with at all. Perhaps a quick alternative, like simply stripping the non MN:-prefixed paragraphs and saving that file as a new document itself might work, without having to deal with a macro?&lt;br&gt;
&lt;br&gt;
In that case, you may have some luck getting started &lt;a href=&quot;http://office.microsoft.com/en-us/help/HA010873041033.aspx&quot;&gt;here&lt;/a&gt;, or with a much more detailed look at regex in word, &lt;a href=&quot;http://www.windowsdevcenter.com/pub/a/windows/excerpt/wdhks_1/index.html?page=4%22%22&quot;&gt;here&lt;/a&gt;.&lt;br&gt;
&lt;br&gt;
Regular expressions are extremely powerful and very flexible. The price you pay is that they&apos;re also a nightmare to parse visually, because your brain isn&apos;t wired quite like that, especially if you don&apos;t program.&lt;br&gt;
&lt;br&gt;
If you&apos;re in the mood for a bit of humor though, check out &lt;a href=&quot;http://xkcd.com/c208.html&quot;&gt;this&lt;/a&gt; comic strip, once you&apos;ve figured it out.&lt;/&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864102</guid>
		<pubDate>Thu, 22 Feb 2007 09:06:21 -0800</pubDate>
		<dc:creator>disillusioned</dc:creator>
	</item><item>
		<title>By: jasper411</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864122</link>	
		<description>Whoa, disillusioned!  I&apos;d never heard of using regular expressions in Word!  Thank you so much for the awesome links!!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864122</guid>
		<pubDate>Thu, 22 Feb 2007 09:21:05 -0800</pubDate>
		<dc:creator>jasper411</dc:creator>
	</item><item>
		<title>By: solid-one-love</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864160</link>	
		<description>This should work:&lt;br&gt;
&lt;br&gt;
Sub CopyPara&lt;br&gt;
&lt;br&gt;
    Selection.Find.ClearFormatting&lt;br&gt;
    With Selection.Find&lt;br&gt;
        .Text = &quot;What You&apos;re Searching For&quot;&lt;br&gt;
        .Replacement.Text = &quot;&quot;&lt;br&gt;
        .Forward = True&lt;br&gt;
        .Wrap = wdFindContinue&lt;br&gt;
        .Format = False&lt;br&gt;
        .MatchCase = False&lt;br&gt;
        .MatchWholeWord = False&lt;br&gt;
        .MatchWildcards = False&lt;br&gt;
        .MatchSoundsLike = False&lt;br&gt;
        .MatchAllWordForms = False&lt;br&gt;
    End With&lt;br&gt;
    Selection.StartOf Unit:=wdParagraph&lt;br&gt;
    Selection.MoveEnd Unit:=wdParagraph&lt;br&gt;
    Selection.Copy&lt;br&gt;
    Documents.Add DocumentType:=wdNewBlankDocument&lt;br&gt;
    Selection.PasteAndFormat (wdPasteDefault)&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
That macro will find the first instance of your text; you can probably figure out how to make it find them all.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864160</guid>
		<pubDate>Thu, 22 Feb 2007 10:07:04 -0800</pubDate>
		<dc:creator>solid-one-love</dc:creator>
	</item><item>
		<title>By: Jeff_Larson</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864182</link>	
		<description>How exaclty would I make the above find all matches? I&apos;m working in Word 2000 and it doesn&apos;t have a &quot;match all&quot; option in the find dialog box (as far as I can tell).</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864182</guid>
		<pubDate>Thu, 22 Feb 2007 10:27:43 -0800</pubDate>
		<dc:creator>Jeff_Larson</dc:creator>
	</item><item>
		<title>By: grouse</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864222</link>	
		<description>In Word 2003 there is a checkbox for &lt;strong&gt;Highlight all items found in: Main Document&lt;/strong&gt;&lt;br&gt;
&lt;br&gt;
&lt;small&gt;&lt;em&gt;finds patterns of mr, ms, mrs, and dr without periods&lt;/em&gt;&lt;br&gt;
&lt;br&gt;
Of course, it also finds drr, drs, ds, dsr, dss, mrr, msr, and mss. Another example of why it&apos;s sometimes not good to be too clever with the regexes.&lt;/small&gt;</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864222</guid>
		<pubDate>Thu, 22 Feb 2007 10:56:11 -0800</pubDate>
		<dc:creator>grouse</dc:creator>
	</item><item>
		<title>By: solid-one-love</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864224</link>	
		<description>OK, give this a shot:&lt;br&gt;
&lt;br&gt;
Sub CopyParas&lt;br&gt;
Selection.Find.ClearFormatting&lt;br&gt;
With Selection.Find&lt;br&gt;
   .Text = &quot;The Text You Want to Find&quot;&lt;br&gt;
   .Forward = True&lt;br&gt;
   .Wrap = wdFindStop&lt;br&gt;
   .Format = False&lt;br&gt;
   .MatchCase = False&lt;br&gt;
   .MatchWholeWord = False&lt;br&gt;
   .MatchWildcards = False&lt;br&gt;
   .MatchSoundsLike = False&lt;br&gt;
   .MatchAllWordForms = False&lt;br&gt;
End With&lt;br&gt;
Do While Selection.Find.Execute&lt;br&gt;
    Selection.StartOf Unit:=wdParagraph&lt;br&gt;
    Selection.MoveEnd Unit:=wdParagraph&lt;br&gt;
    sBigString = sBigString + Selection.Text&lt;br&gt;
    Selection.MoveStart Unit:=wdParagraph&lt;br&gt;
Loop&lt;br&gt;
    Documents.Add DocumentType:=wdNewBlankDocument&lt;br&gt;
    Selection.InsertAfter (sBigString)&lt;br&gt;
End Sub&lt;br&gt;
&lt;br&gt;
This should copy every paragraph starting with your text to a string and then past the string into a new document. Replace the text after &lt;b&gt;.Text&lt;/b&gt; as appropriate for your needs. &lt;br&gt;
&lt;br&gt;
(I am assuming that you know how to -- or can figure out how to -- copy and use a macro via Tools --&amp;gt; Macro --&amp;gt; Visual Basic Editor.)</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864224</guid>
		<pubDate>Thu, 22 Feb 2007 11:00:21 -0800</pubDate>
		<dc:creator>solid-one-love</dc:creator>
	</item><item>
		<title>By: Jeff_Larson</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864250</link>	
		<description>Wow. Awesome. Thanks!</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864250</guid>
		<pubDate>Thu, 22 Feb 2007 11:23:48 -0800</pubDate>
		<dc:creator>Jeff_Larson</dc:creator>
	</item><item>
		<title>By: Baud</title>
		<link>http://ask.metafilter.com/57463/Find-Copy-and-Paste-a-Paragraph-into-a-new-Word-Document#864479</link>	
		<description>you may also want to have a look at &lt;a href=&quot;http://www.autohotkey.com/&quot;&gt;autohotkey&lt;/a&gt;.</description>
		<guid isPermaLink="false">comment:ask.metafilter.com,2007:site.57463-864479</guid>
		<pubDate>Thu, 22 Feb 2007 14:48:44 -0800</pubDate>
		<dc:creator>Baud</dc:creator>
	</item>
	</channel>
</rss>
