Re: [python-win32] Failed to load Win32uiApplicationInit

2025-04-10 Thread Steven Manross
I am presuming this was installed on a Windows system and therefore testing that the windows installation has no system file linkage issues would be appropriate. While this is a shot in the dark, have you ran: # scan for and fix any issues it finds sfc /scannow # and # to check for windows sy

Re: [python-win32] Classic ASP -> Response.Cookies access

2024-10-26 Thread Steven Manross
atch type: Key = 3, 1610743812 # method dispatch type: QueryInterface = 3, 1610612736 # Displays None Response.Write(f"DEFAULT DISPATCH NAME = {this._olerepr_.defaultDispatchName}") # displays all the methods/attributes of the object and helped me create the “method” for loop above Re

Re: [python-win32] Classic ASP -> Response.Cookies access

2024-10-23 Thread Steven Manross
wEnum', '__lt__', '_LazyAddAttr_', '__LazyMap__', '__len__', '_ApplyTypes_', '__dir__', '__bool__', '_lazydata_', '__getattr__', '_make_method_', '__AttrToID__', '__init__', &#x

[python-win32] Classic ASP -> Response.Cookies access

2024-10-23 Thread Steven Manross
I'm not sure if this is implemented or not in the Python ASP code or not, but I am trying to duplicate some VBS code in Python, and use the URL below as a primer as I couldn't find any info on the internet about how Python might implement this kind of ASP code. I know the link is SUPER OLD but

Re: [python-win32] [ANN] pywin32 build 307 released

2024-10-04 Thread Steven Manross
Kudos and Thank You, Mark and anyone else involved. Steven From: python-win32 On Behalf Of Mark Hammond Sent: Friday, October 4, 2024 1:13 PM To: python-win32@python.org Subject: [python-win32] [ANN] pywin32 build 307 released Hi all, I'm happy to announce the release of pywin32 build 307. The

Re: [python-win32] Calling a method with SAFEARRAY parameter

2024-09-26 Thread Steven Manross
I’m not sure about the context on this one, but shouldn’t you be calling the COM object with data like: columnTitles = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_BSTR, [“something”]) Versus: columnTitles = VARIANT(pythoncom.VT_ARRAY | pythoncom.VT_BSTR, [None]) Without

Re: [python-win32] win32crypt.PFXImportCertStore()

2024-09-24 Thread Steven Manross
s # Call the CryptUIWizImport API result = cryptui.CryptUIWizImport( CRYPTUI_WIZ_NO_UI, None, None, ctypes.byref(import_src), hMyCertStore # define the cert store you want to import to ) # check for errors and then return true on success return True From: Stev

Re: [python-win32] win32crypt.PFXImportCertStore()

2024-09-23 Thread Steven Manross
se Steven From: python-win32 On Behalf Of Steven Manross Sent: Sunday, September 22, 2024 1:14 PM To: python-win32@python.org Subject: [python-win32] win32crypt.PFXImportCertStore() Howdy, I am trying to import a PFX/P12 certificate to the local machine certificate store and there’s no erro

[python-win32] win32crypt.PFXImportCertStore()

2024-09-22 Thread Steven Manross
Howdy, I am trying to import a PFX/P12 certificate to the local machine certificate store and there’s no errors, but it also doesn’t seem to work either. I’ve left a bit of debugging code in the script to show all the things I’ve tried, but again there’s no errors, and it generates the PyStore

Re: [python-win32] PyWin32 Advanced Options

2024-01-19 Thread Steven Manross
Your mileage may vary, but while using setprinter.exe for a similar task (many years ago) I found that the different trays can sometimes be large values like 260… Your best bet might be to set the tray manually in the UI, and then try to look at those values via something like setprinter.exe T

Re: [python-win32] Uninstallation Command Required

2023-09-20 Thread Steven Manross
As well, you can look in the windows registry in the Uninstall key (but need to find the specific key for your python installer) # this registry key is for version 3.9.12 (but the only thing that would change on other versions would be the final key name: the GUID) HKEY_LOCAL_MACHINE\SOFTWARE\M

Re: [python-win32] Question win32com.client.Dispatch

2023-07-11 Thread Steven Manross
When building your “AutoCad.Application” object, it looks like 2007 is the default object… In your computer’s registry directly under HKEY_CLASSES_ROOT you should be able to find a Key (FOLDER icon) that matches that name… as well, IF AutoCAD has different versions installed , you should be ab

Re: [python-win32] Setting Focus Assist Mode via COM

2023-05-31 Thread Steven Manross
nvalid class string". Best regards! On Tuesday, May 30, 2023 at 11:41:25 PM GMT+2, Steven Manross mailto:ste...@manross.net>> wrote: While I haven’t worked on exactly what you are working on: I’d first verify suggest that the application that installs this class needs to

Re: [python-win32] Setting Focus Assist Mode via COM

2023-05-30 Thread Steven Manross
While I haven’t worked on exactly what you are working on: I’d first verify suggest that the application that installs this class needs to be installed on the PC you are trying to create the automation from, because “Class not Registered” isn’t a python error, and it talks more directly to the

Re: [python-win32] unknow solution

2023-05-30 Thread Steven Manross
While I’ve done word automation in the past, is it possible that there’s any issues with the word application installation itself? Or maybe you might have multiple scripts trying to open/write files simultaneously? As well, I might consider looking at task manager on your web server to see if

Re: [python-win32] makepy.py "Some COM library"

2023-05-30 Thread Steven Manross
I’m always happy to help. Steven From: Mark Hammond Sent: Tuesday, May 30, 2023 11:01 AM To: Steven Manross ; python-win32@python.org Subject: Re: [python-win32] makepy.py "Some COM library" Does something like `python -c "from win32com.client.gencache import EnsureDispatch;

[python-win32] makepy.py "Some COM library"

2023-05-30 Thread Steven Manross
Command I ran: C:\Python311\Lib\site-packages\win32com\client>python makepy.py "ADODB.Connection.6.0" Output: Generating to C:\Users\someuser\AppData\Local\Temp\13\gen_py\3.11\B691E011-1797-432E-907A-4D8C69339129x0x6x1.py Building definitions from type library... Generating... Importing module

Re: [python-win32] Win32: -2147418113, 'Catastrophic failure'

2023-05-23 Thread Steven Manross
And just to reiterate what Mark said, but also validate that this is the case from code: You should be able to run this without issue… (and validate pywin32 works fine) mydict = win32com.client.Dispatch("Scripting.Dictionary") … since the “Scripting.Dictionary” COM class lives on every windows

Re: [python-win32] GetNetworkConnections fails since a Windows update

2023-05-03 Thread Steven Manross
That happens here too in Win10/Win11 using your code. It looks like Microsoft altered the COM object for you not to be able to do a GetNetwork or GetCategory on the connection object, but that seems odd since it basically renders the object pointless. P.S. some powershell code doesn't seem to

Re: [python-win32] Accessing Documentation Through Command Prompt / Help File

2023-04-10 Thread Steven Manross
https://learn.microsoft.com/en-us/windows/win32/api/winuser/nf-winuser-keybd_event Personally, I’ve been using pyautogui a lot to do mostly mouse input (but it handles keyboard operations too)… It seems that there isn’t a lot of MSDN documentation from Microsoft on this subject though. Steven

Re: [python-win32] Pywin32 Windows Service not responding

2023-03-25 Thread Steven Manross
Something seems to be stripping your code at about 40-50 characters and it seems like we are missing the right half of your code. Example: _svc_description_ = 'This is a sample Python Wind Steven From: python-win32 On Behalf Of jeremy.farmer1206 via python-win32 Sent: Friday, March 24, 2023 1

Re: [python-win32] How to add citations to a word document

2023-03-16 Thread Steven Manross
problem (likely because I started from a blank document). Steven From: Ryan Dikdan Sent: Thursday, March 16, 2023 10:12 PM To: Steven Manross ; python-win32@python.org Subject: Re: How to add citations to a word document Thank you!! I've made a lot of progress. I've been able t

Re: [python-win32] How to add citations to a word document

2023-03-01 Thread Steven Manross
I'd probably start by creating a test Word document and adding a source manually in it from the Word GUI. Then, I would likely want to do something like this in python. # Sample python to list the bibliography entries import win32com.client wordapp = win32com.client.gencache.EnsureDispatch("Wo

Re: [python-win32] taskscheduler: how to tick setting "Run task as soon as possible after scheduled start is missed"

2023-01-08 Thread Steven Manross
I haven’t seen a response for this yet, but… I have done work with the TaskScheduler in powershell, and in powershell you can do something like this: PS C:\Users\Administrator.DOMAIN> (Get-ScheduledTask -TaskName mytask).Settings AllowDemandStart: True AllowHardTerminate

Re: [python-win32] pywin32 in python 64bit-3.7 environment

2022-07-05 Thread Steven Manross
https://anaconda.org/anaconda/pywin32 ... suggests: conda install -c anaconda pywin32 BUT, that is version 302 according to the URL above. As for the EXE, I don't think that PIP will install from an EXE. I hope this helps, but I literally know nothing about anaconda. I'm sure that someone el

Re: [python-win32] Need a value from pywin32

2022-06-22 Thread Steven Manross
pes.PULONG, # pReturnLength ) I HOPE THIS HELPS AND THANK YOU VERY MUCH! Steven -Original Message- From: Eryk Sun Sent: Wednesday, June 22, 2022 1:28 PM To: Steven Manross Cc: python-win32@python.org Subject: Re: [python-win32] Need a value from pywin32 On 6/21/22, Steven Manross wrote:

Re: [python-win32] Need a value from pywin32

2022-06-22 Thread Steven Manross
lf Of Tim Roberts Sent: Tuesday, June 21, 2022 10:04 PM To: python-win32@python.org Subject: Re: [python-win32] Need a value from pywin32 On 6/21/22 13:39, Steven Manross wrote: > I was intrigued by this and I would like to get it to work, but I cannot... > I know I'm doing something

Re: [python-win32] Need a value from pywin32

2022-06-21 Thread Steven Manross
I was intrigued by this and I would like to get it to work, but I cannot... I know I'm doing something wrong, but don't know what. I will leave this for the archives, and maybe it will help someone else some day. My guess is that the issue is the conversion of the winsta_handle to a ctypes.c_

Re: [python-win32] Load custom font

2022-06-09 Thread Steven Manross
Sorry… But, I need to Give credit where credit is due. https://superuser.com/questions/1432800/get-actual-font-name-of-ttf-file-from-command-line From: python-win32 On Behalf Of Steven Manross Sent: Thursday, June 9, 2022 12:24 PM To: Jérémie Bergeron ; python-win32@python.org Subject: Re

Re: [python-win32] Load custom font

2022-06-09 Thread Steven Manross
Here’s a more windows centric approach and it foreaches through all the Windows fonts: ** It’s interesting that it says that it was last modified today… odd, but whatever from win32com.client.dynamic import Dispatch ids = [0,1,2,3,4,5,6,9,10,19,21,25,33,34,58,62,165,166,167,170,191,192,193,

Re: [python-win32] Load custom font

2022-06-09 Thread Steven Manross
While this isn't win32ui, I hope it helps. pip install Pillow from PIL import ImageFont font = ImageFont.truetype("c:\\windows\\Fonts\\verdana.ttf", 28, encoding="unic") font.font.family font.font.height font.font.style google search revealed this: https://stackoverflow.com/questions/24085996/

Re: [python-win32] Inquiry about Sending HTML format in Appointment in Outlook Application

2022-05-27 Thread Steven Manross
As I recall, Calendar Items are a special kind of MailItem, and there is Body and BodyHTML on a mailItem which represent the “Text Body” and the “HTMLBody”. https://docs.microsoft.com/en-us/office/vba/api/outlook.mailitem.bodyformat As well, there is a MailItem.BodyFormat which is supposed to be

Re: [python-win32] Import Certificate with Private Key to Current Computer Certificate store

2022-05-26 Thread Steven Manross
store.Close() Kudos to the below powershell script for the primer that I adapted to Python.NET. https://gist.github.com/smaglio81/19146391f7f94e2449e16d3318be1ef7 Steven -----Original Message- From: Steven Manross Sent: Thursday, May 26, 2022 7:32 PM To: Steven Manross ; mhamm...@skippinet

Re: [python-win32] Import Certificate with Private Key to Current Computer Certificate store

2022-05-26 Thread Steven Manross
st I can get it done (for now). Steven -Original Message- From: python-win32 On Behalf Of Steven Manross Sent: Thursday, May 26, 2022 5:49 PM To: mhamm...@skippinet.com.au; python-win32@python.org Subject: Re: [python-win32] Import Certificate with Private Key to Current Computer Certific

Re: [python-win32] Import Certificate with Private Key to Current Computer Certificate store

2022-05-26 Thread Steven Manross
I'll give it a shot... Thanks! Steven -Original Message- From: Mark Hammond Sent: Thursday, May 26, 2022 5:45 PM To: Steven Manross ; python-win32@python.org Subject: Re: [python-win32] Import Certificate with Private Key to Current Computer Certificate store Hi! I know a

[python-win32] Import Certificate with Private Key to Current Computer Certificate store

2022-05-26 Thread Steven Manross
Howdy, I am finishing up some work on requesting certificates from an internal Microsoft CA, and then importing the certs to the local windows certificate store, butd was having difficulty determining what function to use to import a Certificate with Private Key (P12/PFX) to a the computer's Ce

Re: [python-win32] IIS ASP webpage issues with minimal pyscript

2022-05-21 Thread Steven Manross
hours, and you finally figure out a way around it. 😊 Steven -Original Message- From: Steven Manross Sent: Saturday, May 21, 2022 6:28 PM To: python-win32@python.org Subject: IIS ASP webpage issues with minimal pyscript Howdy, I have pywin32 ASP Scripts using Python 3.10.4 x64

Re: [python-win32] Reading email body from Outlook: Operation aborted

2022-05-15 Thread Steven Manross
The one thing that I see in this code is: * there is a possible problem with how you are calling the Outlook.Application object, namely you are doing a "GetActiveObject" and this could fail if Outlook is not already open. If you are sure that Outlook will always be open when you run your pyth

Re: [python-win32] [ANN] pywin32 build 304 released

2022-05-02 Thread Steven Manross
: Steven Manross ; python-win32@python.org Subject: Re: [python-win32] [ANN] pywin32 build 304 released On 3/05/2022 5:31 am, Steven Manross wrote: > Thanks for the new version! > > Considering I've been on build 227 forever, I tried upgrading my webserver's > pywin32 build

Re: [python-win32] [ANN] pywin32 build 304 released

2022-05-02 Thread Steven Manross
Thanks for the new version! Considering I've been on build 227 forever, I tried upgrading my webserver's pywin32 build to 304 with a base of Activestate Python 3.8 (64-bit), and now I'm getting errors in my ASP pages ("500" Server Error), and in ipython (below). Ive done all the normal things l

Re: [python-win32] file name contains brackets got converted to %5B and %5D

2022-04-11 Thread Steven Manross
After thinking about this for a bit … I thought that if the COM object is doing this and there’s no way to fix that behavior, you should be able to change the file name AFTER the COM object is done, via python like so. # this works on my W10 PC import os # make sure the file handle and or COM

Re: [python-win32] pywin32 question

2022-03-13 Thread Steven Manross
Type) print(f"Session: {s['SessionId']} - State = {session_types[s['State']]} --> User: {user} -- Protocol: {protocols[protocol]}") win32ts.WTSCloseServer(ts_connection) output: Session: 1 - State = Active --> User: myusername -- Protocol: RDP Sessi

Re: [python-win32] pywin32 question

2022-03-13 Thread Steven Manross
While I don’t have a huge environment to test in, this seems to work remotely from my win 10 pc to my Windows Server 2016 which has remote admin RDP enabled… I would assume it’s the same APIs to talk to a full fledged WTS Server. Kudos to the internet for having the answer already written down

Re: [python-win32] pywin can not access excel file

2021-12-12 Thread Steven Manross
s[0] worksheet.Range("A1").Value # Ipython output: In [5]: worksheet.Range("A1").Value Out[5]: 'this is a test' P.S. Im also a fan of F-strings... wb = ExcelApp.Workbooks.Open(f"{filename}") OR more simply wb = ExcelApp.Workbooks.Open(f

Re: [python-win32] pywin can not access excel file

2021-12-12 Thread Steven Manross
Is this a typo on the email or is your production code really referencing filename and fileName? You need to reference the variable name using the same casing in both places (if this is not a typo in your email example). P.S. I don't think you need the 4 backslashes.. 2 usually does the trick,

Re: [python-win32] Outlook Add-In Demo Question ... A runtime error occurred during the loading of the com add-in

2021-12-09 Thread Steven Manross
: Re: [python-win32] Outlook Add-In Demo Question ... A runtime error occurred during the loading of the com add-in Steven Manross wrote: > Correct me if I am wrong... but Office 2010+ comes in 64-bit and 32-bit > versions. I know that 2019 definitely does. Both are available, but until

Re: [python-win32] Outlook Add-In Demo Question ... A runtime error occurred during the loading of the com add-in

2021-12-08 Thread Steven Manross
Correct me if I am wrong... but Office 2010+ comes in 64-bit and 32-bit versions. I know that 2019 definitely does. Providing he matches his Python architecture (32 or 64) to his Office application architecture (32 or 64), it should work unless that code has issues working in 64-bit mode? I

Re: [python-win32] mail Sensitivity doesn't work as expected(can not set the sensitivity label)

2021-11-17 Thread Steven Manross
As best I remember, Microsoft considers the programming of Mail tasks (and most Outlook automation) as a security risk/issue, and limits your access to certain parts because so many people (malware writers) wrote stuff to programmatically abuse Outlook for unsavory (Evil?!?) purposes. However,

Re: [python-win32] returning #N/A to Excel via UDF

2021-11-17 Thread Steven Manross
While I don’t have any useful suggestions here… I thought I would link the thread I found in the xlwings github thread that the author looks to have been working on with them already. https://github.com/xlwings/xlwings/issues/776 HTH Steven From: python-win32 On Behalf Of Sébastien de Mente

[python-win32] Access Denied on Eventlogs - possible solution(s)

2021-09-17 Thread Steven Manross
Howdy. I replied offline to the author earlier in my day about what might be the problem he is running into (I was in digest mode until today and couldnt just reply to the thread - apologies), but played around with this script a little today and seem to have something that can pass credentials

[python-win32] Calling Dispatch - Error -2147221005

2021-07-20 Thread Steven Manross
Seems like you have the class string invalid… “Outlook Application” should read “Outlook.Application” Note the period. 😊 And then of course, you need Outlook installed, and the correct 32-bit or 64-bit version of Outlook for your python version. HTH and Enjoy Steven _

[python-win32] How to copy an image using win32clipboard

2020-12-01 Thread Steven Manross
Based on reading http://timgolden.me.uk/pywin32-docs/win32clipboard__GetClipboardData_meth.html I would suggest that getting image data from the clipboard isn't implemented yet, but I do not know that for sure as I don't know when that document was updated. However, this python code seems to g

Re: [python-win32] IIS and ASP: If blocks that span multiple code blocks

2020-11-03 Thread Steven Manross
re created), and in that case, I just converted to python dictionaries since they are SO flexible and come OOTB without need for COM objects (like in VBScript). HTH someone Steven -Original Message- From: Mark Hammond Sent: Monday, November 02, 2020 3:50 PM To: Steven Manross ; python

[python-win32] IIS and ASP: If blocks that span multiple code blocks

2020-11-01 Thread Steven Manross
I was wondering if there's any way to support this style of coding in ASP/Python. This works in VBScript (but I'm trying to remove all my VBScript), but I seem to be getting hit by the fact that each block of code is being analyzed as a single block of code and the "if" not being able to span m