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
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
wEnum', '__lt__',
'_LazyAddAttr_', '__LazyMap__', '__len__', '_ApplyTypes_', '__dir__',
'__bool__', '_lazydata_', '__getattr__', '_make_method_', '__AttrToID__',
'__init__',
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
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
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
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
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
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
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
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
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
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
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
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
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;
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
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
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
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
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
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
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
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
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
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:
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
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_
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
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,
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/
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
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
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
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
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
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
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
: 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
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
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
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
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
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
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
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
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
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,
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
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
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
_
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 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
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
54 matches
Mail list logo