Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
Alan Gauld wrote: "bob gailer" <[EMAIL PROTECTED]> wrote docOrig = app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchProject.doc') range = docOrig.Content() Try range = docOrig.Range() But don't use range as a variable name or you will hide the builtin function range(). And

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread Alan Gauld
"bob gailer" <[EMAIL PROTECTED]> wrote docOrig = app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchProject.doc') range = docOrig.Content() Try range = docOrig.Range() But don't use range as a variable name or you will hide the builtin function range(). And that will make many

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
Marc Tompkins wrote: On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <[EMAIL PROTECTED] > wrote: Thanks for the suggestion. When I ran the slightly modified code: import win32com.client app = win32com.client.Dispatch('Word.Application') docOrig =

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread Marc Tompkins
On Tue, Oct 14, 2008 at 9:23 AM, URBAN LANDREMAN <[EMAIL PROTECTED]> wrote: > Thanks for the suggestion. > > When I ran the slightly modified code: > import win32com.client > app = win32com.client.Dispatch('Word.Application') > docOrig = > app.Documents.Open('n:\\MetroPlanners\\2006\\MCHResearchPr

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread URBAN LANDREMAN
e 5, in range.Find.Text = "e" AttributeError: 'unicode' object has no attribute 'Find' For what it's worth, I'm running Python 2.5.2 Urban Date: Tue, 14 Oct 2008 11:32:03 -0400 From: [EMAIL PROTECTED] To: [EMAIL PROTECTED] CC: tutor@python.org Subject: Re:

Re: [Tutor] Edit a Word document programmatically CORRECTION Open not open

2008-10-14 Thread bob gailer
bob gailer wrote: Brian C. Lane wrote: -BEGIN PGP SIGNED MESSAGE- Hash: SHA1 URBAN LANDREMAN wrote: Good morning, I'm trying to write some Python code to programmatically do a Find and Replace of a string within a Microsoft Word document. Any suggestions on wh