<div dir="ltr">On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <span dir="ltr">&lt;<a href="mailto:ulandreman@msn.com">ulandreman@msn.com</a>&gt;</span> wrote:<br><div class="gmail_quote"><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">




<div><div style="text-align: left;">Thanks for the suggestion.<br><br>When I ran the slightly modified code:<br>import win32com.client<br>app = win32com.client.Dispatch(&#39;Word.Application&#39;)<br>docOrig = app.Documents.Open(&#39;n:\\MetroPlanners\\2006\\MCHResearchProject.doc&#39;)<br>
range = docOrig.Content()<br>range.Find.Text = &quot;e&quot;<br>range.Find.Replacement.Text = &quot;*&quot;<br>range.Find.Execute()<br>docEditted = doc<br>docEditted.SaveAs(&#39;n:\\MetroPlanners\\2006\\MCHResearchProjectV2.doc&#39;)<br>
app.Quit()<br><br><br>I got:<br><br>Traceback (most recent call last):<br>&nbsp; File &quot;N:/SPSS/Python/Examples/MSWord/WordFindAndReplaceV2&quot;, line 5, in &lt;module&gt;<br>&nbsp;&nbsp;&nbsp; range.Find.Text = &quot;e&quot;<br>AttributeError: &#39;unicode&#39; object has no attribute &#39;Find&#39;<br>
</div></div></blockquote><div><br>docOrig.Content() returns you a Unicode object, which isn&#39;t the same as a Word document at all.&nbsp; You&#39;re then trying to use methods on that object which aren&#39;t supported.&nbsp; I can&#39;t give you specifics without doing a bit of Googling myself, but you probably want a different call on line 4 to give you an object you can work with.<br>
<br></div></div><br>-- <br><a href="http://www.fsrtechnologies.com">www.fsrtechnologies.com</a><br>
</div>