From Yann.Schoeni at moutier.ch Wed May 2 11:32:01 2018 From: Yann.Schoeni at moutier.ch (Schoeni, Yann) Date: Wed, 2 May 2018 15:32:01 +0000 Subject: [python-win32] Raise exception for printers Message-ID: <2f3da5b517fc4e85806362931072e082@moutier.ch> Hey guys, I'm trying to get error informations from my printer. The job is sending from a web application, the application use the php function ? Shell_exec ? to call the python CLI and passe the arguments to the python script. Anyway, I first tried to raise an exception if the printer isn't turn on, but it's harder than I thought, is there an easy way to do it ? I tried to do it by using the command ? GetPrinter ? but nothing seems to point the power state of the printer. Here is a sample of my code job = win32print.OpenPrinter(printer_name) printer_info = win32print.GetPrinter(job, 2) for key, value in printer_info.items() : print (key, value) return value : pServerName None pPrinterName DTC1250e Card Printer pShareName DTC1250 pPortName USB001 pDriverName DTC1250e Card Printer pComment pLocation pDevMode pSepFile pPrintProcessor winprint pDatatype RAW pParameters pSecurityDescriptor Attributes 11848 Priority 1 DefaultPriority 0 StartTime 1380 UntilTime 1380 Status 0 cJobs 18 AveragePPM 0 If someone has an idea, it would be nice. Is there a solution to check if the ink or paper runs out ? Thank you guys ! Meilleures salutations Yann Schoeni Municipalit? de Moutier Apprenti informaticien T?l. +41 (0)32 494 11 69 Mob. +41 (0)79 827 30 86 E-mail yann.schoeni at moutier.ch -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Wed May 2 13:29:10 2018 From: timr at probo.com (Tim Roberts) Date: Wed, 2 May 2018 10:29:10 -0700 Subject: [python-win32] Raise exception for printers In-Reply-To: <2f3da5b517fc4e85806362931072e082@moutier.ch> References: <2f3da5b517fc4e85806362931072e082@moutier.ch> Message-ID: <554cbb9b-2c46-52f9-cdbf-3be1aa2ecbd3@probo.com> Schoeni, Yann wrote: > ? > > I?m trying to get error informations from my printer. > > ? > > The job is sending from a web application, the application use the php > function ??Shell_exec?? to call the python CLI and passe the arguments > to the python script. > > ? > > Anyway, I first tried to raise an exception if the printer isn?t turn > on, but it?s harder than I thought, is there an easy way to do it?? > > ? > > I tried to do it by using the command ??GetPrinter?? but nothing seems > to point the power state of the printer. > The "Status" value tells you some of that information.? The bits are defined here: ??? https://msdn.microsoft.com/en-us/library/cc244854.aspx Power state is a tricky thing for the system to handle.? The spooler wants to allow you to submit print jobs even if the printer is off or offline, because it will probably come back at some point.? I suspect you will find PRINTER_STATUS_SERVER_OFFLINE in that case. -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From dan.spisak at appdynamics.com Wed May 2 16:39:36 2018 From: dan.spisak at appdynamics.com (Daniel Spisak) Date: Wed, 2 May 2018 13:39:36 -0700 Subject: [python-win32] Questions regarding pypiwin32 and python 2.7 Message-ID: Hello! I am trying to do some updates of some systems that utilize pypiwin32 and python 2.7 and I have some confusion about how to go about this. First, a few things: What is the difference between pypiwin32 and pywin32? Is it just packaging in wheel format? Why does https://github.com/Googulator/pypiwin32/releases show 220 as latest, but https://pypi.org/project/pypiwin32/#files shows 223? Is that not the official repo for pypiwin32? Why is there no python 2.7 wheel for pypiwin32 223? Thanks! -- * Daniel Spisak * | Senior Dev Ops Engineer, Synthetic *AppDynamics* Monitor your Apps in Production. Now. Watch our Video | Download AppDynamics for Free Twitter | Facebook | appdynamics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From skippy.hammond at gmail.com Wed May 2 18:44:49 2018 From: skippy.hammond at gmail.com (Mark Hammond) Date: Thu, 3 May 2018 08:44:49 +1000 Subject: [python-win32] Questions regarding pypiwin32 and python 2.7 In-Reply-To: References: Message-ID: <81ad84db-347f-861a-b4dd-242844191f9e@gmail.com> On 3/05/2018 6:39 am, Daniel Spisak wrote: > Hello! > > I am trying to do some updates of some systems that utilize pypiwin32 > and python 2.7 and I have some confusion about how to go about this. > First, a few things: > > What is the difference between pypiwin32 and pywin32? Is it just > packaging in wheel format? pypiwin32 is a "fork" of pywin32 which existed purely to have support for pypi. @xoviat helped roll the necessary changes into pywin32 itself, so pypiwin32 is effectively deprecated. > Why does https://github.com/Googulator/pypiwin32/releases show 220 as > latest, but https://pypi.org/project/pypiwin32/#files shows 223? As part of helping the migration, pywin32 builds with wheel support were also added to pypiwin32, but that's unlikely to continue happening. > Is that not the official repo for pypiwin32? It is, but pypiwin32 isn't really official. You should move to using https://pypi.python.org/pypi/pywin32 which is built from https://github.com/mhammond/pywin32 - although note that the wheels aren't directly on github - the pywin32 release process builds both executable installers and wheels with the former uploaded only to github and the latter uploaded only to pypi. If there was a good reason to put the wheels directly on github, I'd be happy to also do that for future releases. HTH, Mark From dan.spisak at appdynamics.com Wed May 2 19:49:51 2018 From: dan.spisak at appdynamics.com (Daniel Spisak) Date: Wed, 2 May 2018 16:49:51 -0700 Subject: [python-win32] Questions regarding pypiwin32 and python 2.7 In-Reply-To: <81ad84db-347f-861a-b4dd-242844191f9e@gmail.com> References: <81ad84db-347f-861a-b4dd-242844191f9e@gmail.com> Message-ID: Mark, If its possible, could the wheels be published? I have an installer I need to update which I have to give wheels to in case of an offline install scenario. Thanks for the explanation of everything, there wasn't exactly a dearth of information I could find on what was what. On Wed, May 2, 2018 at 3:44 PM, Mark Hammond wrote: > On 3/05/2018 6:39 am, Daniel Spisak wrote: > >> Hello! >> >> I am trying to do some updates of some systems that utilize pypiwin32 and >> python 2.7 and I have some confusion about how to go about this. First, a >> few things: >> >> What is the difference between pypiwin32 and pywin32? Is it just >> packaging in wheel format? >> > > pypiwin32 is a "fork" of pywin32 which existed purely to have support for > pypi. @xoviat helped roll the necessary changes into pywin32 itself, so > pypiwin32 is effectively deprecated. > > Why does https://urldefense.proofpoint.com/v2/url?u=https-3A__github. >> com_Googulator_pypiwin32_releases&d=DwICaQ&c=3_5eq9zYXWRS8yw >> qccmjfTRKM8mRLoQp6HBg1Tdb_Pc&r=_QuE6ARaq2J9IS-4FqXeU4nXe6zu >> nMP1RyjCZUIUDMM&m=B7er2K1hsinpLm8CBJNpm1Xeej84iMQzscPOn_ >> PQRyE&s=InoyjNLOcKp1wBkpkVxBhdDqTYsq0CAsvyGHnEix8YY&e= show 220 as >> latest, but https://urldefense.proofpoint.com/v2/url?u=https-3A__pypi.or >> g_project_pypiwin32_-23files&d=DwICaQ&c=3_5eq9zYXWRS8ywqccm >> jfTRKM8mRLoQp6HBg1Tdb_Pc&r=_QuE6ARaq2J9IS-4FqXeU4nXe6zunMP >> 1RyjCZUIUDMM&m=B7er2K1hsinpLm8CBJNpm1Xeej84iMQzscPOn_PQRyE& >> s=g4p0prP88emnLggwFbwLTAssto8zW8gBpuKWnbmPiq4&e= shows 223? >> > > As part of helping the migration, pywin32 builds with wheel support were > also added to pypiwin32, but that's unlikely to continue happening. > > Is that not the official repo for pypiwin32? >> > > It is, but pypiwin32 isn't really official. You should move to using > https://urldefense.proofpoint.com/v2/url?u=https-3A__pypi.py > thon.org_pypi_pywin32&d=DwICaQ&c=3_5eq9zYXWRS8ywqccmjfTRKM8m > RLoQp6HBg1Tdb_Pc&r=_QuE6ARaq2J9IS-4FqXeU4nXe6zunMP > 1RyjCZUIUDMM&m=B7er2K1hsinpLm8CBJNpm1Xeej84iMQzscPOn_PQRyE& > s=DgmRxIR3dxlfzsIyhdr5YWHhmPBEMDszDggweBo6MDY&e= which is built from > https://urldefense.proofpoint.com/v2/url?u=https-3A__github. > com_mhammond_pywin32&d=DwICaQ&c=3_5eq9zYXWRS8ywqccmjfTRKM8mR > LoQp6HBg1Tdb_Pc&r=_QuE6ARaq2J9IS-4FqXeU4nXe6zunMP > 1RyjCZUIUDMM&m=B7er2K1hsinpLm8CBJNpm1Xeej84iMQzscPOn_PQRyE& > s=IX-sctiKG9DEKsarGfWrPOohKSvwrRIz7KkLzUrXBRA&e= - although note that the > wheels aren't directly on github - the pywin32 release process builds both > executable installers and wheels with the former uploaded only to github > and the latter uploaded only to pypi. If there was a good reason to put the > wheels directly on github, I'd be happy to also do that for future releases. > > HTH, > > Mark > -- * Daniel Spisak * | Senior Dev Ops Engineer, Synthetic *AppDynamics* Monitor your Apps in Production. Now. Watch our Video | Download AppDynamics for Free Twitter | Facebook | appdynamics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From mhammond at skippinet.com.au Wed May 2 21:59:00 2018 From: mhammond at skippinet.com.au (Mark Hammond) Date: Thu, 3 May 2018 11:59:00 +1000 Subject: [python-win32] Questions regarding pypiwin32 and python 2.7 In-Reply-To: References: <81ad84db-347f-861a-b4dd-242844191f9e@gmail.com> Message-ID: <596cf381-7584-6dba-93bd-a512bec1e1a9@skippinet.com.au> On 3/05/2018 9:49 am, Daniel Spisak wrote: > Mark, > > ? ? ?If its possible, could the wheels be published? I have an > installer I need to update which I have to give wheels to in case of an > offline install scenario. Thanks for the explanation of everything, > there wasn't exactly a dearth of information I could find on what was what. Can't you grab them directly from https://pypi.org/project/pywin32/#files ? Mark From dan.spisak at appdynamics.com Thu May 3 11:30:47 2018 From: dan.spisak at appdynamics.com (Daniel Spisak) Date: Thu, 3 May 2018 08:30:47 -0700 Subject: [python-win32] Questions regarding pypiwin32 and python 2.7 In-Reply-To: <596cf381-7584-6dba-93bd-a512bec1e1a9@skippinet.com.au> References: <81ad84db-347f-861a-b4dd-242844191f9e@gmail.com> <596cf381-7584-6dba-93bd-a512bec1e1a9@skippinet.com.au> Message-ID: Weird, I missed that somehow. Thanks! On Wed, May 2, 2018 at 6:59 PM, Mark Hammond wrote: > On 3/05/2018 9:49 am, Daniel Spisak wrote: > >> Mark, >> >> If its possible, could the wheels be published? I have an installer >> I need to update which I have to give wheels to in case of an offline >> install scenario. Thanks for the explanation of everything, there wasn't >> exactly a dearth of information I could find on what was what. >> > > Can't you grab them directly from https://urldefense.proofpoint. > com/v2/url?u=https-3A__pypi.org_project_pywin32_-23files&d= > DwIDaQ&c=3_5eq9zYXWRS8ywqccmjfTRKM8mRLoQp6HBg1Tdb_Pc&r=_ > QuE6ARaq2J9IS-4FqXeU4nXe6zunMP1RyjCZUIUDMM&m=BTt-i1ORsTi-TC7 > CNumyi5Qiwty5TJv8Kw7e-WOFPCE&s=NOut0n6nTCt03CL2I9LbyvUQpC9H > 4dI7CtmBLbGwNI8&e= ? > > Mark > -- * Daniel Spisak * | Senior Dev Ops Engineer, Synthetic *AppDynamics* Monitor your Apps in Production. Now. Watch our Video | Download AppDynamics for Free Twitter | Facebook | appdynamics.com -------------- next part -------------- An HTML attachment was scrubbed... URL: From cnkhanh1986 at gmail.com Fri May 4 02:54:13 2018 From: cnkhanh1986 at gmail.com (ng khanh) Date: Fri, 4 May 2018 01:54:13 -0500 Subject: [python-win32] get Object methods of win32com excel app Message-ID: Hi, How to get all methods available of an excel win32com object (win32com.gen_py.Microsoft Excel 16.0 Object Library.ChartObject) ? Sometimes, the object methods in excel VBA editor is diffrent Thanks -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.cetin at yahoo.com Tue May 22 04:31:13 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Tue, 22 May 2018 08:31:13 +0000 (UTC) Subject: [python-win32] COM Automation: Problem Accessing Property of Object References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> Message-ID: <2100000038.3998974.1526977873100@mail.yahoo.com> Hi, I've been looking for a solution to this question for some time now. Hopefully you could help me out. There's a program (Golden Software Surfer) that I have successfully automated using Python COM. I normally am able to control every portion I need. The part I have trouble accessing is under its "Property Manager". Even though I am using the description provided in the software's documents & help files I get an error saying: AttributeError: '' object has no attribute 'ShowColorScale' "ShowColorScale" is just an example of one property/method in the Property Manager window. Here is the example code I have been working with: import win32com.client srf = win32com.client.gencache.EnsureDispatch('Surfer.Application') Plot = srf.Documents.Add(1) srf.Visible = True MapFrame1 = Plot.Shapes.AddImageMap(GridFileName="C:/test.grd") ImageLayer1 = MapFrame1.Overlays(1) ImageLayer1.ShowColorScale = True # this is where i get the error The full error message:KeyError Traceback (most recent call last) C:\Program Files\Anaconda3\lib\site-packages\win32com\client\__init__.py in __setattr__(self, attr, value) 470 try: --> 471 args, defArgs=self._prop_map_put_[attr] 472 except KeyError: KeyError: 'ShowColorScale' During handling of the above exception, another exception occurred: AttributeError Traceback (most recent call last) in () ----> 1 ImageLayer1.ShowColorScale = True # test C:\Program Files\Anaconda3\lib\site-packages\win32com\client\__init__.py in __setattr__(self, attr, value) 471 args, defArgs=self._prop_map_put_[attr] 472 except KeyError: --> 473 raise AttributeError("'%s' object has no attribute '%s'" % (repr(self), attr)) 474 self._oleobj_.Invoke(*(args + (value,) + defArgs)) 475 def _get_good_single_object_(self, obj, obUserName=None, resultCLSID=None): AttributeError: '' object has no attribute 'ShowColorScale' After searching on the net I found this question, asked here 10 years ago:[python-win32] COM automation: problem accessing property of derived object obtained from collection ? python-win32 ? ActiveState List Archives | | | | | | | | | | | [python-win32] COM automation: problem accessing property of derived obj... | | | It's almost identical to my issue. The author mentions that he found a solution on his latest post too. But doesn't post the solution itself. Just something regarding CastTo and then gives two links for reference. (Tried to search and understand CastTo without any success, couldn't understand how to implement it to the code above.) I'm new to programming & Python.. especially to COM. I would really appreciate it if some one could help me solve this. [Python3.6, Surfer13] -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue May 22 13:05:33 2018 From: timr at probo.com (Tim Roberts) Date: Tue, 22 May 2018 10:05:33 -0700 Subject: [python-win32] COM Automation: Problem Accessing Property of Object In-Reply-To: <2100000038.3998974.1526977873100@mail.yahoo.com> References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> <2100000038.3998974.1526977873100@mail.yahoo.com> Message-ID: <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> Emre CETIN via python-win32 wrote: > Hi, I've been looking for a solution to this question for some time > now. Hopefully you could help me out. There's a program (Golden > Software Surfer) that I have successfully automated using Python COM. > I normally am able to control every portion I need. The part I have > trouble accessing is under its "Property Manager". Even though I am > using the description provided in the software's documents & help > files I get an error saying: > > AttributeError: ' instance at 0x2327715907232>' object has no attribute 'ShowColorScale' > > "ShowColorScale" is just an example of one property/method in the > Property Manager window. > > Here is the example code I have been working with: > |importwin32com.client srf > =win32com.client.gencache.EnsureDispatch('Surfer.Application')Plot=srf.Documents.Add(1)srf.Visible=TrueMapFrame1=Plot.Shapes.AddImageMap(GridFileName="C:/test.grd")ImageLayer1=MapFrame1.Overlays(1)ImageLayer1.ShowColorScale=True# > this is where i get the error| The problem here, I think, is that ShowColorScale is a property of the IContourMap interface, but you've been given an IShape interface.? One of the issues about COM is that some objects implement many different interfaces, and you have to know which interface to ask for to get the methods and properties you want. The answer, as the old poster suggested, is to query the IShape object for its IContourMap interface.? It shouldn't be very much more complicated than this: ??? ImageMap1 = ImageLayer1.CastTo( "IContourMap" ) ??? ImageMap1.ShowColorScale = True -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From e.cetin at yahoo.com Tue May 22 16:08:40 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Tue, 22 May 2018 20:08:40 +0000 (UTC) Subject: [python-win32] COM Automation: Problem Accessing Property of Object In-Reply-To: <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> <2100000038.3998974.1526977873100@mail.yahoo.com> <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> Message-ID: <234333013.4258656.1527019720890@mail.yahoo.com> Thank you for your reply. I wanted to try it but for seom reason the code that has been running without a problem suddenly gave this error: import win32com.client srf = win32com.client.gencache.EnsureDispatch('Surfer.Application')? # after this line of code the error below is produced... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 srf = win32com.client.gencache.EnsureDispatch('Surfer.Application') C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureDispatch(prog_id, bForDemand) 538 tlb, index = ti.GetContainingTypeLib() 539 tla = tlb.GetLibAttr() --> 540 mod = EnsureModule(tla[0], tla[1], tla[3], tla[4], bForDemand=bForDemand) 541 GetModuleForCLSID(disp_clsid) 542 # Get the class from the module. C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureModule(typelibCLSID, lcid, major, minor, progressInstance, bValidateFile, bForDemand, bBuildHidden) 395 try: 396 try: --> 397 module = GetModuleForTypelib(typelibCLSID, lcid, major, minor) 398 except ImportError: 399 # If we get an ImportError C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in GetModuleForTypelib(typelibCLSID, lcid, major, minor) 264 # module to our cache though - check that here. 265 if "_in_gencache_" not in mod.__dict__: --> 266 AddModuleToCache(typelibCLSID, lcid, major, minor) 267 assert "_in_gencache_" in mod.__dict__ 268 return mod C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in AddModuleToCache(typelibclsid, lcid, major, minor, verbose, bFlushNow) 556 # module - this doesn't mean anything special though! 557 mod._in_gencache_ = 1 --> 558 dict = mod.CLSIDToClassMap 559 info = str(typelibclsid), lcid, major, minor 560 for clsid, cls in dict.items(): AttributeError: module 'win32com.gen_py.54C3F9A2-980B-1068-83F9-0000C02A351Cx0x1x4' has no attribute 'CLSIDToClassMap' Any idea of what this is and how to solve it? E m r e On Tuesday, May 22, 2018, 8:14:34 PM GMT+3, Tim Roberts wrote: Emre CETIN via python-win32 wrote: > Hi, I've been looking for a solution to this question for some time > now. Hopefully you could help me out. There's a program (Golden > Software Surfer) that I have successfully automated using Python COM. > I normally am able to control every portion I need. The part I have > trouble accessing is under its "Property Manager". Even though I am > using the description provided in the software's documents & help > files I get an error saying: > > AttributeError: ' instance at 0x2327715907232>' object has no attribute 'ShowColorScale' > > "ShowColorScale" is just an example of one property/method in the > Property Manager window. > > Here is the example code I have been working with: > |importwin32com.client srf > =win32com.client.gencache.EnsureDispatch('Surfer.Application')Plot=srf.Documents.Add(1)srf.Visible=TrueMapFrame1=Plot.Shapes.AddImageMap(GridFileName="C:/test.grd")ImageLayer1=MapFrame1.Overlays(1)ImageLayer1.ShowColorScale=True# > this is where i get the error| The problem here, I think, is that ShowColorScale is a property of the IContourMap interface, but you've been given an IShape interface.? One of the issues about COM is that some objects implement many different interfaces, and you have to know which interface to ask for to get the methods and properties you want. The answer, as the old poster suggested, is to query the IShape object for its IContourMap interface.? It shouldn't be very much more complicated than this: ??? ImageMap1 = ImageLayer1.CastTo( "IContourMap" ) ??? ImageMap1.ShowColorScale = True -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Tue May 22 17:47:07 2018 From: timr at probo.com (Tim Roberts) Date: Tue, 22 May 2018 14:47:07 -0700 Subject: [python-win32] COM Automation: Problem Accessing Property of Object In-Reply-To: <365256603.4283379.1527022645991@mail.yahoo.com> References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> <2100000038.3998974.1526977873100@mail.yahoo.com> <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> <234333013.4258656.1527019720890@mail.yahoo.com> <274959172.4258726.1527020495426@mail.yahoo.com> <365256603.4283379.1527022645991@mail.yahoo.com> Message-ID: <6ceb0a4c-b6d1-d194-bb68-53fbd84066a2@probo.com> Emre CETIN wrote: > > Finally I got it to work! Here it is: > > |importwin32com.client srf > =win32com.client.gencache.EnsureDispatch('Surfer.Application')Plot=srf.Documents.Add(1)srf.Visible=TrueMapFrame1=Plot.Shapes.AddImageMap(GridFileName="C:/test.grd")ImageLayer1=MapFrame1.Overlays(1)ImageMap1 > = win32com.client.CastTo(ImageLayer1, "IImageLayer") # the property > was under IImageLayer ImageMap1.ShowColorScale = True| > For future maintenance purposes, you might consider changing the names to match the interfaces: ??? Shape1 = MapFrame1.Overlays(1) ??? ImageLayer1 = win32com.client.CastTo(Shape1, "IImageLayer" ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From e.cetin at yahoo.com Tue May 22 16:21:35 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Tue, 22 May 2018 20:21:35 +0000 (UTC) Subject: [python-win32] COM Automation: Problem Accessing Property of Object In-Reply-To: <234333013.4258656.1527019720890@mail.yahoo.com> References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> <2100000038.3998974.1526977873100@mail.yahoo.com> <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> <234333013.4258656.1527019720890@mail.yahoo.com> Message-ID: <274959172.4258726.1527020495426@mail.yahoo.com> Hi again, I solved the unexpected error I just posted by following this link: https://mail.python.org/pipermail/python-list/2008-July/509467.html There is said to: "Just in case, could you delete the contents of your gen_py directory (probably in %TEMP%\gen_py)"That did it. Now I was able to test your answer. But I got this error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 ImageMap1 = ImageLayer1.CastTo("IContourMap") C:\Program Files\Anaconda3\lib\site-packages\win32com\client\__init__.py in __getattr__(self, attr) 463 args=self._prop_map_get_.get(attr) 464 if args is None: --> 465 raise AttributeError("'%s' object has no attribute '%s'" % (repr(self), attr)) 466 return self._ApplyTypes_(*args) 467 AttributeError: '' object has no attribute 'CastTo' I tried adding an import for it to work: import win32com.client from win32com.client import CastTo? # tried adding this line but it didn't change the error. E m r e On Tuesday, May 22, 2018, 11:09:45 PM GMT+3, Emre CETIN via python-win32 wrote: Thank you for your reply. I wanted to try it but for seom reason the code that has been running without a problem suddenly gave this error: import win32com.client srf = win32com.client.gencache.EnsureDispatch('Surfer.Application')? # after this line of code the error below is produced... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 srf = win32com.client.gencache.EnsureDispatch('Surfer.Application') C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureDispatch(prog_id, bForDemand) 538 tlb, index = ti.GetContainingTypeLib() 539 tla = tlb.GetLibAttr() --> 540 mod = EnsureModule(tla[0], tla[1], tla[3], tla[4], bForDemand=bForDemand) 541 GetModuleForCLSID(disp_clsid) 542 # Get the class from the module. C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureModule(typelibCLSID, lcid, major, minor, progressInstance, bValidateFile, bForDemand, bBuildHidden) 395 try: 396 try: --> 397 module = GetModuleForTypelib(typelibCLSID, lcid, major, minor) 398 except ImportError: 399 # If we get an ImportError C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in GetModuleForTypelib(typelibCLSID, lcid, major, minor) 264 # module to our cache though - check that here. 265 if "_in_gencache_" not in mod.__dict__: --> 266 AddModuleToCache(typelibCLSID, lcid, major, minor) 267 assert "_in_gencache_" in mod.__dict__ 268 return mod C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in AddModuleToCache(typelibclsid, lcid, major, minor, verbose, bFlushNow) 556 # module - this doesn't mean anything special though! 557 mod._in_gencache_ = 1 --> 558 dict = mod.CLSIDToClassMap 559 info = str(typelibclsid), lcid, major, minor 560 for clsid, cls in dict.items(): AttributeError: module 'win32com.gen_py.54C3F9A2-980B-1068-83F9-0000C02A351Cx0x1x4' has no attribute 'CLSIDToClassMap' Any idea of what this is and how to solve it? E m r e On Tuesday, May 22, 2018, 8:14:34 PM GMT+3, Tim Roberts wrote: Emre CETIN via python-win32 wrote: > Hi, I've been looking for a solution to this question for some time > now. Hopefully you could help me out. There's a program (Golden > Software Surfer) that I have successfully automated using Python COM. > I normally am able to control every portion I need. The part I have > trouble accessing is under its "Property Manager". Even though I am > using the description provided in the software's documents & help > files I get an error saying: > > AttributeError: ' instance at 0x2327715907232>' object has no attribute 'ShowColorScale' > > "ShowColorScale" is just an example of one property/method in the > Property Manager window. > > Here is the example code I have been working with: > |importwin32com.client srf > =win32com.client.gencache.EnsureDispatch('Surfer.Application')Plot=srf.Documents.Add(1)srf.Visible=TrueMapFrame1=Plot.Shapes.AddImageMap(GridFileName="C:/test.grd")ImageLayer1=MapFrame1.Overlays(1)ImageLayer1.ShowColorScale=True# > this is where i get the error| The problem here, I think, is that ShowColorScale is a property of the IContourMap interface, but you've been given an IShape interface.? One of the issues about COM is that some objects implement many different interfaces, and you have to know which interface to ask for to get the methods and properties you want. The answer, as the old poster suggested, is to query the IShape object for its IContourMap interface.? It shouldn't be very much more complicated than this: ??? ImageMap1 = ImageLayer1.CastTo( "IContourMap" ) ??? ImageMap1.ShowColorScale = True -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From e.cetin at yahoo.com Tue May 22 16:57:25 2018 From: e.cetin at yahoo.com (Emre CETIN) Date: Tue, 22 May 2018 20:57:25 +0000 (UTC) Subject: [python-win32] COM Automation: Problem Accessing Property of Object In-Reply-To: <274959172.4258726.1527020495426@mail.yahoo.com> References: <2100000038.3998974.1526977873100.ref@mail.yahoo.com> <2100000038.3998974.1526977873100@mail.yahoo.com> <08182880-476e-a226-6b1e-7e1259bf7a65@probo.com> <234333013.4258656.1527019720890@mail.yahoo.com> <274959172.4258726.1527020495426@mail.yahoo.com> Message-ID: <365256603.4283379.1527022645991@mail.yahoo.com> Hello again, Finally I got it to work! Here it is: import win32com.client srf = win32com.client.gencache.EnsureDispatch('Surfer.Application') Plot = srf.Documents.Add(1) srf.Visible = True MapFrame1 = Plot.Shapes.AddImageMap(GridFileName="C:/test.grd") ImageLayer1 = MapFrame1.Overlays(1) ImageMap1 = win32com.client.CastTo(ImageLayer1, "IImageLayer") # the property was under IImageLayer ImageMap1.ShowColorScale = True Your help lead me to the solution. I now understand what the issue was and how to use CastTo to get it working. Thank you and Mr.Hammond so much during for all your help! Best regards, E m r e On Tuesday, May 22, 2018, 11:21:35 PM GMT+3, Emre CETIN wrote: Hi again, I solved the unexpected error I just posted by following this link: https://mail.python.org/pipermail/python-list/2008-July/509467.html There is said to: "Just in case, could you delete the contents of your gen_py directory (probably in %TEMP%\gen_py)"That did it. Now I was able to test your answer. But I got this error: --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 ImageMap1 = ImageLayer1.CastTo("IContourMap") C:\Program Files\Anaconda3\lib\site-packages\win32com\client\__init__.py in __getattr__(self, attr) 463 args=self._prop_map_get_.get(attr) 464 if args is None: --> 465 raise AttributeError("'%s' object has no attribute '%s'" % (repr(self), attr)) 466 return self._ApplyTypes_(*args) 467 AttributeError: '' object has no attribute 'CastTo' I tried adding an import for it to work: import win32com.client from win32com.client import CastTo? # tried adding this line but it didn't change the error. E m r e On Tuesday, May 22, 2018, 11:09:45 PM GMT+3, Emre CETIN via python-win32 wrote: Thank you for your reply. I wanted to try it but for seom reason the code that has been running without a problem suddenly gave this error: import win32com.client srf = win32com.client.gencache.EnsureDispatch('Surfer.Application')? # after this line of code the error below is produced... --------------------------------------------------------------------------- AttributeError Traceback (most recent call last) in () ----> 1 srf = win32com.client.gencache.EnsureDispatch('Surfer.Application') C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureDispatch(prog_id, bForDemand) 538 tlb, index = ti.GetContainingTypeLib() 539 tla = tlb.GetLibAttr() --> 540 mod = EnsureModule(tla[0], tla[1], tla[3], tla[4], bForDemand=bForDemand) 541 GetModuleForCLSID(disp_clsid) 542 # Get the class from the module. C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in EnsureModule(typelibCLSID, lcid, major, minor, progressInstance, bValidateFile, bForDemand, bBuildHidden) 395 try: 396 try: --> 397 module = GetModuleForTypelib(typelibCLSID, lcid, major, minor) 398 except ImportError: 399 # If we get an ImportError C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in GetModuleForTypelib(typelibCLSID, lcid, major, minor) 264 # module to our cache though - check that here. 265 if "_in_gencache_" not in mod.__dict__: --> 266 AddModuleToCache(typelibCLSID, lcid, major, minor) 267 assert "_in_gencache_" in mod.__dict__ 268 return mod C:\Program Files\Anaconda3\lib\site-packages\win32com\client\gencache.py in AddModuleToCache(typelibclsid, lcid, major, minor, verbose, bFlushNow) 556 # module - this doesn't mean anything special though! 557 mod._in_gencache_ = 1 --> 558 dict = mod.CLSIDToClassMap 559 info = str(typelibclsid), lcid, major, minor 560 for clsid, cls in dict.items(): AttributeError: module 'win32com.gen_py.54C3F9A2-980B-1068-83F9-0000C02A351Cx0x1x4' has no attribute 'CLSIDToClassMap' Any idea of what this is and how to solve it? E m r e On Tuesday, May 22, 2018, 8:14:34 PM GMT+3, Tim Roberts wrote: Emre CETIN via python-win32 wrote: > Hi, I've been looking for a solution to this question for some time > now. Hopefully you could help me out. There's a program (Golden > Software Surfer) that I have successfully automated using Python COM. > I normally am able to control every portion I need. The part I have > trouble accessing is under its "Property Manager". Even though I am > using the description provided in the software's documents & help > files I get an error saying: > > AttributeError: ' instance at 0x2327715907232>' object has no attribute 'ShowColorScale' > > "ShowColorScale" is just an example of one property/method in the > Property Manager window. > > Here is the example code I have been working with: > |importwin32com.client srf > =win32com.client.gencache.EnsureDispatch('Surfer.Application')Plot=srf.Documents.Add(1)srf.Visible=TrueMapFrame1=Plot.Shapes.AddImageMap(GridFileName="C:/test.grd")ImageLayer1=MapFrame1.Overlays(1)ImageLayer1.ShowColorScale=True# > this is where i get the error| The problem here, I think, is that ShowColorScale is a property of the IContourMap interface, but you've been given an IShape interface.? One of the issues about COM is that some objects implement many different interfaces, and you have to know which interface to ask for to get the methods and properties you want. The answer, as the old poster suggested, is to query the IShape object for its IContourMap interface.? It shouldn't be very much more complicated than this: ??? ImageMap1 = ImageLayer1.CastTo( "IContourMap" ) ??? ImageMap1.ShowColorScale = True -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 _______________________________________________ python-win32 mailing list python-win32 at python.org https://mail.python.org/mailman/listinfo/python-win32 -------------- next part -------------- An HTML attachment was scrubbed... URL: From vmuriart at gmail.com Tue May 22 16:33:08 2018 From: vmuriart at gmail.com (Victor Uriarte) Date: Tue, 22 May 2018 13:33:08 -0700 Subject: [python-win32] Relative Import error on Python 3 Message-ID: When I run `from win32com import adsi` on PY3 I get an exception `ModuleNotFoundError: No module named 'adsi'` from `win32comext\adsi\__init__.py` I took a look around and saw someone opened an issue with a patch before ( https://sourceforge.net/p/pywin32/bugs/620/). Is this an issue with the installation included in Anaconda? -------------- next part -------------- An HTML attachment was scrubbed... URL: From ahz001 at gmail.com Tue May 22 23:25:48 2018 From: ahz001 at gmail.com (Andrew Ziem) Date: Tue, 22 May 2018 21:25:48 -0600 Subject: [python-win32] large buffer with GetOpenFileNameW Message-ID: When I select a few files, the dialog works, but when I select many files, I get the following error. Do you have any advice? error: (12291, 'GetOpenFileNameW', 'No error message is available') Error 12291 is FNERR_BUFFERTOOSMALL The full code is below import win32con import win32gui ret = win32gui.GetOpenFileNameW(None, Flags=win32con.OFN_ALLOWMULTISELECT | win32con.OFN_EXPLORER | win32con.OFN_FILEMUSTEXIST | win32con.OFN_HIDEREADONLY) Andrew From timr at probo.com Thu May 24 14:10:18 2018 From: timr at probo.com (Tim Roberts) Date: Thu, 24 May 2018 11:10:18 -0700 Subject: [python-win32] large buffer with GetOpenFileNameW In-Reply-To: References: Message-ID: <4aaff24c-9bc5-56c5-6078-b2b79043bacc@probo.com> Andrew Ziem wrote: > When I select a few files, the dialog works, but when I select many > files, I get the following error. Do you have any advice? > > error: (12291, 'GetOpenFileNameW', 'No error message is available') > > Error 12291 is FNERR_BUFFERTOOSMALL Yes.? The code in win32gui.i only allocates a buffer of 1,024 characters.? If you select more than that, you'll get FNERR_BUFFERTOOSMALL. There may be a slimy way to work around this.? The code allocates the larger of 1024 characters or the size of the File parameter.?? You could try something like ??? win32gui.GetOpenFileName( None, File='\x00' * 2048, Flags=... ) -- Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ckkart at hoc.net Sat May 26 08:21:08 2018 From: ckkart at hoc.net (ckkart at hoc.net) Date: Sat, 26 May 2018 09:21:08 -0300 Subject: [python-win32] get MAPI session from OOM Message-ID: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> Hi, on a 64bit windows 7 machine with pywin32 221 I used to get a pointer to the MAPI session like this outlook.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession) on a fresh windows 10 machine with pywin32 221 this fails with pywintypes.com_error: (-2147467259, 'Unknown error', None, None) Any idea why this is failing? How can I debug it? Christian From timr at probo.com Sat May 26 20:54:36 2018 From: timr at probo.com (Tim Roberts) Date: Sat, 26 May 2018 17:54:36 -0700 Subject: [python-win32] get MAPI session from OOM In-Reply-To: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> Message-ID: <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> On May 26, 2018, at 5:21 AM, ckkart at hoc.net wrote: > > on a 64bit windows 7 machine with pywin32 221 I used to get a pointer to the MAPI session like this > > outlook.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession) > > on a fresh windows 10 machine with pywin32 221 this fails with > > pywintypes.com_error: (-2147467259, 'Unknown error', None, None) Is this a fresh Windows 10 machine that includes a copy of Microsoft Outlook? ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ram at rachum.com Sun May 27 09:36:04 2018 From: ram at rachum.com (Ram Rachum) Date: Sun, 27 May 2018 16:36:04 +0300 Subject: [python-win32] Wait for a window with a specified title Message-ID: Hi everyone, I'd like to use the `wmi` module to detect when a window with the title "Foo Bar" was created, and then kill the process that created this window. Is this possible? (I can do the killing without `wmi`, I just need to ID the process.) Note that I don't want to be periodically polling for that window, I want to be listening to an event so there wouldn't be a big delay. Thanks for your help! Ram. -------------- next part -------------- An HTML attachment was scrubbed... URL: From c.kristukat at hoc.net Sat May 26 21:07:50 2018 From: c.kristukat at hoc.net (c.kristukat at hoc.net) Date: Sat, 26 May 2018 22:07:50 -0300 Subject: [python-win32] get MAPI session from OOM In-Reply-To: <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> Message-ID: Am 26. Mai 2018 21:54:36 GMT-03:00 schrieb timr at probo.com: >On May 26, 2018, at 5:21 AM, ckkart at hoc.net wrote: >> >> on a 64bit windows 7 machine with pywin32 221 I used to get a pointer >to the MAPI session like this >> >> >outlook.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession) >> >> on a fresh windows 10 machine with pywin32 221 this fails with >> >> pywintypes.com_error: (-2147467259, 'Unknown error', None, None) > >Is this a fresh Windows 10 machine that includes a copy of Microsoft >Outlook? Yes, exactly. I moved my office 16 license to the new machine which had office 365 pre-installed. Christian From c.kristukat at hoc.net Sun May 27 13:58:09 2018 From: c.kristukat at hoc.net (c.kristukat at hoc.net) Date: Sun, 27 May 2018 17:58:09 +0000 Subject: [python-win32] get MAPI session from OOM In-Reply-To: <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> Message-ID: ------ Originalnachricht ------ Von: timr at probo.com An: "Python-Win32 List" Gesendet: 26.05.2018 21:54:36 Betreff: Re: [python-win32] get MAPI session from OOM >On May 26, 2018, at 5:21 AM, ckkart at hoc.net wrote: >> >>on a 64bit windows 7 machine with pywin32 221 I used to get a pointer >>to the MAPI session like this >> >>outlook.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession) >> >>on a fresh windows 10 machine with pywin32 221 this fails with >> >>pywintypes.com_error: (-2147467259, 'Unknown error', None, None) > >Is this a fresh Windows 10 machine that includes a copy of Microsoft >Outlook? Yes, exactly. I moved my office 16 license to the new machine which had office 365 pre-installed. Christian From timr at probo.com Mon May 28 00:11:25 2018 From: timr at probo.com (Tim Roberts) Date: Sun, 27 May 2018 21:11:25 -0700 Subject: [python-win32] Wait for a window with a specified title In-Reply-To: References: Message-ID: On May 27, 2018, at 6:36 AM, Ram Rachum wrote: > > I'd like to use the `wmi` module to detect when a window with the title "Foo Bar" was created, and then kill the process that created this window. Is this possible? Not with WMI, no. > (I can do the killing without `wmi`, I just need to ID the process.) > > Note that I don't want to be periodically polling for that window, I want to be listening to an event so there wouldn't be a big delay. I don't know how much overhead you are willing to impose, but you can always install a WH_CALLWNDPROC window hook and look for WM_CREATE messages. That injects a DLL into every process in the system, so I'm not convinced it can be done with Python. You may need to write a C++ DLL and have it communicate with your Python process. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ram at rachum.com Mon May 28 01:19:43 2018 From: ram at rachum.com (Ram Rachum) Date: Mon, 28 May 2018 08:19:43 +0300 Subject: [python-win32] Wait for a window with a specified title In-Reply-To: References: Message-ID: On Mon, May 28, 2018 at 7:11 AM, Tim Roberts wrote: > On May 27, 2018, at 6:36 AM, Ram Rachum wrote: > > > > I'd like to use the `wmi` module to detect when a window with the title > "Foo Bar" was created, and then kill the process that created this window. > Is this possible? > > Not with WMI, no. > > > > (I can do the killing without `wmi`, I just need to ID the process.) > > > > Note that I don't want to be periodically polling for that window, I > want to be listening to an event so there wouldn't be a big delay. > > I don't know how much overhead you are willing to impose, but you can > always install a WH_CALLWNDPROC window hook and look for WM_CREATE > messages. That injects a DLL into every process in the system, so I'm not > convinced it can be done with Python. You may need to write a C++ DLL and > have it communicate with your Python process. > Oh, that sounds heavy. I guess I'm back to polling. Any idea how to do this with polling? Thanks for your help! > ? > Tim Roberts, timr at probo.com > Providenza & Boekelheide, Inc. > > _______________________________________________ > python-win32 mailing list > python-win32 at python.org > https://mail.python.org/mailman/listinfo/python-win32 > -------------- next part -------------- An HTML attachment was scrubbed... URL: From timr at probo.com Mon May 28 01:33:01 2018 From: timr at probo.com (Tim Roberts) Date: Sun, 27 May 2018 22:33:01 -0700 Subject: [python-win32] Wait for a window with a specified title In-Reply-To: References: Message-ID: On May 27, 2018, at 10:19 PM, Ram Rachum wrote: > > Oh, that sounds heavy. I guess I'm back to polling. Any idea how to do this with polling? It would be easy with polling. You'd use EnumWindows to go through the list of all top-level windows, GetWindowText to get the window title, GetWindowThreadProcessId to convert the window handle to a process ID. You may not actually need the process ID. You could just send a WM_CLOSE message to the window. Unless the process is trying to protect itself, that's usually enough. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. -------------- next part -------------- An HTML attachment was scrubbed... URL: From ckkart at hoc.net Wed May 30 14:23:43 2018 From: ckkart at hoc.net (ckkart at hoc.net) Date: Wed, 30 May 2018 15:23:43 -0300 Subject: [python-win32] get MAPI session from OOM In-Reply-To: References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> Message-ID: <0f4846a15f08ccddcd3d8f4ffdfa78bc@www.hoc.net> Am 2018-05-27 14:58, schrieb c.kristukat at hoc.net: > ------ Originalnachricht ------ > Von: timr at probo.com > An: "Python-Win32 List" > Gesendet: 26.05.2018 21:54:36 > Betreff: Re: [python-win32] get MAPI session from OOM > >> On May 26, 2018, at 5:21 AM, ckkart at hoc.net wrote: >>> >>> on a 64bit windows 7 machine with pywin32 221 I used to get a pointer >>> to the MAPI session like this >>> >>> outlook.GetNamespace('MAPI').Session.MAPIOBJECT.QueryInterface(mapi.IID_IMAPISession) >>> >>> on a fresh windows 10 machine with pywin32 221 this fails with >>> >>> pywintypes.com_error: (-2147467259, 'Unknown error', None, None) >> >> Is this a fresh Windows 10 machine that includes a copy of Microsoft >> Outlook? > > Yes, exactly. I moved my office 16 license to the new machine which > had office 365 pre-installed. > Any ideas? Do you think it will help to do a fresh install of office 2016? Regards, Christian From timr at probo.com Thu May 31 02:31:35 2018 From: timr at probo.com (Tim Roberts) Date: Wed, 30 May 2018 23:31:35 -0700 Subject: [python-win32] get MAPI session from OOM In-Reply-To: <0f4846a15f08ccddcd3d8f4ffdfa78bc@www.hoc.net> References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> <0f4846a15f08ccddcd3d8f4ffdfa78bc@www.hoc.net> Message-ID: <998602D6-E89E-465C-A920-9532812666E4@probo.com> On May 30, 2018, at 11:23 AM, ckkart at hoc.net wrote: > > > Any ideas? Do you think it will help to do a fresh install of office 2016? In addition to just installing Outlook, have you configured Outlook? You can't access MAPI unless you have incoming and outgoing servers configured and authenticated. ? Tim Roberts, timr at probo.com Providenza & Boekelheide, Inc. From ckkart at hoc.net Thu May 31 12:51:19 2018 From: ckkart at hoc.net (ckkart at hoc.net) Date: Thu, 31 May 2018 13:51:19 -0300 Subject: [python-win32] get MAPI session from OOM In-Reply-To: <998602D6-E89E-465C-A920-9532812666E4@probo.com> References: <02767fc83c6dcac273a7e424d354f92c@www.hoc.net> <7A4B40C2-4041-4F9D-94B8-2A4569D70B24@probo.com> <0f4846a15f08ccddcd3d8f4ffdfa78bc@www.hoc.net> <998602D6-E89E-465C-A920-9532812666E4@probo.com> Message-ID: <7ff1afc3921a5a66d9e5f2dde9150740@www.hoc.net> Am 2018-05-31 03:31, schrieb timr at probo.com: > On May 30, 2018, at 11:23 AM, ckkart at hoc.net wrote: >> >> >> Any ideas? Do you think it will help to do a fresh install of office >> 2016? > > In addition to just installing Outlook, have you configured Outlook? > You can't access MAPI unless you have incoming and outgoing servers > configured and authenticated. I have configured two IMAP accounts in outlook before trying to get the MAPI session. But I have not yet done a clean install. I will keep you updated. Christian