win32com

Retrieve Excel Workbook Connection Properties

Retrieve Excel Workbook Connection Properties Question: I am attempting to grab the “Command Text” from the Connection Property window in an Excel file using python. However, I cannot find the object that contains this information. In the below picture I would like to retrieve the highlighted EXEC sp_FooBar as a string: I am able to …

Total answers: 1

Python How to use DataFrame output in email body as Text

Python How to use DataFrame output in email body as Text Question: I have a output of a dataframe Df , I am able to send it in mail as an attachment, but not able to print Df value in message body. Please advise to print my Df value in email body so I won’t …

Total answers: 3

Adobe Acrobat API in Python

Adobe Acrobat API in Python Question: System: Python 3.6 Windows 10 Goal: Use the Adobe Acrobat API to use the “Save As” feature to save a pdf to jpegs. Note: For my purposes I cannot use Wand or other packages. Resources: Adobe_API_Documentation Implementation_Example 1 Error_Handling_Issue VBA_Example Current Code: import winerror import win32com from win32com.client.dynamic import …

Total answers: 1

Python: error opening excel workbook with win32com

Python: error opening excel workbook with win32com Question: I am trying to make a program to open existing excel files, in order to read and write their contents. I am already having trouble opening files. My code: def open_sheet(): excel = win32com.client.Dispatch(“Excel.Application”) wb = excel.Workbooks(r’C:Users<username>Documents<more file path>test.xls’).Open() ws = wb.Worksheets(‘abc’) # there is a worksheet …

Total answers: 2

How can I use SetJob in win32print?

How can I use SetJob in win32print? Question: I want to clear or delete print jobs using Python. But how can I get JobID? win32print.SetJob(hPrinter, JobID , Level , JobInfo , Command) How could I run this code? jobs = [] for p in win32print.EnumPrinters(win32print.PRINTER_ENUM_LOCAL,None, 1): flags, desc, name, comment = p pHandle = win32print.OpenPrinter(name) …

Total answers: 2

win32com + Outlook only capturing 50% of messages in inbox per execution

win32com + Outlook only capturing 50% of messages in inbox per execution Question: I’ve created a little code with win32com and Python 3.x which simply goes through an Outlook folder and does stuff to the messages inside (move them, read them, etc.). It works flawlessly, except for one strange little problem… Only 50% of the items …

Total answers: 2

Ask for admin access for a Python function in Windows

Ask for admin access for a Python function in Windows Question: I want to copy a list of files to the Windows system directory (C:Windows) using a Python function. I have a function: import shutil def copy_list(src_list, dst): for file in src_list: shutil.copy(file, dst) And I want to call it like this: def copy_as_admin(): #… …

Total answers: 2

Add signature to outlook email with python using win32com

Add signature to outlook email with python using win32com Question: Does anyone know how to add an email signature to an email using win32com? import win32com.client as win32 outlook = win32.Dispatch(‘outlook.application’) mail = outlook.CreateItem(0) mail.To = ‘TO’ mail.Subject = ‘SUBJECT’ mail.HTMLbody = ‘BODY’ mail.send Asked By: Michael David || Source Answers: Outlook signatures are not …

Total answers: 5

Extract sender's email address from Outlook Exchange in Python using win32

Extract sender's email address from Outlook Exchange in Python using win32 Question: I am trying to extract the sender’s email address from outlook 2013 using win32 package in python. There are two kinds of email address type in my Inbox, exchange and smtp. If I try to print the the sender’s email address of Exchange …

Total answers: 3

Using win32com with multithreading

Using win32com with multithreading Question: I am working on a web app with CherryPy that needs to access a few applications via COM. Right now I create a new instance of the application with each request, which means each request waits 3 seconds for the application to start and 0.01 for the actual job. I …

Total answers: 3