[python-win32] AttributeError: 'NoneType' object has no attribute 'PageSetup' (original) (raw)

Tim Roberts timr at probo.com
Thu Jan 10 19:39:44 CET 2008


a_n_s_h_a_n wrote:

hi! newbie here. from the subject, there is an error in the code. could anyone please exlpain why? here's the code:

Your code works fine for me, at least through the Content stuff. You might try setting wordapp.Visible to 1 so you can see what is going on.
For example, do you actually see the new document being created?

... worddoc.Content.Paragraphs.TabStops.Add(100) worddoc.Content.InsertAfter('PDF Filename: ') worddoc.Content.MoveEnd

Unlike VB, that last statement doesn't actually call the MoveEnd function. It just returns its address. To call it, you need to use parens: worddoc.Content.MoveEnd()

-- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc.



More information about the python-win32 mailing list