Re: [python-win32] Help for Excel Pivot Copy

2013-01-29 Thread Tim Golden
On 27/01/2013 12:37, Hsu. Victor (GSM) wrote: > Hi, > > I would like to copy a Pivot table to another location. > I can do that with VBA code below. Can someone guide me how to convert > below code to Python? Especailly the PivotTables PivotSelect part, I > don't know how to call it in py

[python-win32] python win32com design question

2013-01-29 Thread Johannes Frank
Hello, I am currently working with win32com to access ProgeCAD (an AutoCAD Clone) Excel and PDFCreator. Using comobj = win32com.client.Dispatch('xxx') gives me an object through which I can access the COM interface and thus the underlying program. Within my program I have to pass this object ar

Re: [python-win32] OpenDataSource failed in ms-word-mail-merge-automation

2013-01-29 Thread Tim Roberts
Hsu. Victor (GSM) wrote: > > > I am trying to use this python sample code to create automatic > daily report. > > http://bytes.com/topic/python/answers/165364-ms-word-mail-merge-automation > > > > but I always failed to open the data source in CSV file. Is this > python issue or Windows C

Re: [python-win32] python win32com design question

2013-01-29 Thread Mark Hammond
On 29/01/2013 9:48 AM, Johannes Frank wrote: Hello, I am currently working with win32com to access ProgeCAD (an AutoCAD Clone) Excel and PDFCreator. Using comobj = win32com.client.Dispatch('xxx') gives me an object through which I can access the COM interface and thus the underlying program.

Re: [python-win32] OpenDataSource failed inms-word-mail-merge-automation

2013-01-29 Thread Hsu. Victor (GSM)
Hi Tim, I fixed it by doing some modification. data_source_name = os.path.abspath('recipient.csv') mm.OpenDataSource(data_source_name) And the "Word Merge To Document" function works now. However, my intention is to send an email. So I change some setting, #send the merge result to Ema

Re: [python-win32] OpenDataSource failed inms-word-mail-merge-automation

2013-01-29 Thread Hsu. Victor (GSM)
Re-install my Office to English version. Finally know what Word told me. Let me try how to fix this. === F:\MyProgram\python\Word2Email>python Word2Email.py Traceback (most recent call last): File "Word2Email.py", line 41, in mm.Execute() File "F:\Python27\lib\site-packages\win32com\gen

Re: [python-win32] OpenDataSource failed inms-word-mail-merge-automation

2013-01-29 Thread Hsu. Victor (GSM)
Great...finally fix the problem. # #send the merge result to Email mm.MainDocumentType = const.wdEMail mm.Destination = const.wdSendToEmail mm.MailAddressFieldName = "EMail" mm.MailFormat = const.wdMailFormatHTML mm.MailSubject = "This is a test mail from Python Win32---"+time.strftime('%Y_%m_%d