Questions tagged [office-automation]

Use this tag for questions related to automating MS Office Products ( Excel, Outlook, PowerPoint, Access, Word, Project, etc. ). Automation in this context means the use of an external software, not an MS Office product, to execute a variety of operations on MS Office products. For questions about macros use the relevant tags for example "excel" and "vba". Do not use this tag if your question is not about automatic control.

Automation in this context means the use of computer systems to execute a variety of operations such as word processing, spreadsheet calculation, database manipulation, etc. without user interruption.

If you have a specific programming question about Excel or Word (or any other product from the MS Office package) and it is not about automating it via external software then use tags like , , , etc.

805 questions
1
vote
2 answers

ComObject alternative for the New Outlook Preview app

Our organisation is migrating to Office 365, this means mail will be available via Exchange Online so user can access there mail via the webbrowser but also via the "New Outlook Preview" app in Windows 10/11. A suggestion that has been made is to…
1
vote
2 answers

Emails generated using VBA create error when using .send, but not .Display

I have a VBA programme that runs in Excel and creates a collection of about 20 draft Outlook email objects. Simple HTML with no attachments. The user is then given a choice: Send each one directly, using an instruction something like…
Simon J
  • 11
  • 1
1
vote
2 answers

Extract outlook data from multiple emails address or subfolders

I have the below code that extract data from outlook folder and select date range or limit date. However, I am trying to extract data from "multiple outlook folders", but the below code only allow me to select from "1" folder at a time. How can I…
jrpdjb
  • 11
  • 2
1
vote
1 answer

Adding a new folder to an Outlook folder is added as the second folder

I want to add a folder to an existing folder in Outlook. OApp = new(); Ons = OApp.GetNamespace("MAPI"); OMapiFld = Ons.GetDefaultFolder(OlDefaultFolders.olFolderInbox); OFriendsFld = OMapiFld.Folders["Friends"]; OFFolder =…
darbid
  • 2,545
  • 23
  • 55
1
vote
2 answers

Wincom32 Safetly Restrict email in group outlook before searching on subject

I have the following Python code which loops through emails in a group shared outlook mailbox and then saves attachments. However this will do a scan of the entire inbox. I have seen in other answers that this is understandably a terrible idea…
John Smith
  • 2,448
  • 7
  • 54
  • 78
1
vote
1 answer

The Protect method or property is not available because this command cannot be used in read mode.Net

I use the library: Microsoft.Office.Interop.Word. Word 2016 itself. The program copies the file to the folder C:\temp, the document itself is edited, and then moved to another folder. The program falls off in this piece of code: var newPath =…
jull
  • 11
  • 1
1
vote
2 answers

How to read outlook emails using Interop.Outlook in C# without crashing?

I am trying to read the emails from a shared mailbox which has multiple folders and files. But I get the below mentioned error and the application completes the task without returning any data. Error message: error Here is the method where the…
1
vote
2 answers

How do i get my code to only select a .csv attachment and not the image from within the email txt?

I currently have the below code that works perfectly if the email is blank but if it comes as part of a chain and it has images (ie company logos in peoples signature etc) then it will only find those. How do i filter it to only select the .csv? …
1
vote
2 answers

CreateOleObject('Outlook.Application') not works with Outlook 365 when outlook is open

I need help resolving an issue with my code for adding Outlook Tasks. It is functioning correctly on some systems, but not on a machine with Office 365 installed. Specifically, when Outlook is already open on this machine, my code produces an error.…
1
vote
1 answer

What is the correct, modern, c++ to call the Office automation COM APIs

I haven't used c++ much in years, and have no experience with using COM from c++. I've written some code in c# using Office interop to work with Word, Excel, and PowerPoint, but am struggling to port that to c++. I've found Office Automation Using…
UnionP
  • 1,251
  • 13
  • 26
1
vote
1 answer

Outlook COM object - Marking an Email as Read

Using w32 python library, I am taking an email and saving the attachment from Outlook. I have seen several questions dealing with this topic with the most promising being here: Marking an email as read python I have tried a few variations of the…
John Smith
  • 2,448
  • 7
  • 54
  • 78
1
vote
1 answer

Remove the "RE:" when replying to emails using Python

I am using python to automate some outlook email replies and I need to remove the "RE:" from the subject when using the email.ReplyAll(), I tried to do email.Subject = subject before replying but it still adds the "RE:". FYI, I do not intend to…
jks
  • 13
  • 6
1
vote
0 answers

Image manipulation with C# microsoft.office.interop.excel

I'm new to C#. I'm doing Excel automation. I am printing data from database to excel and showing this excel in spreadsheet. But I have image data of type byte in database and I am having trouble printing the image. I access the data in the database…
1
vote
2 answers

Save email attachment from Outlook as a tempfile in Python

How do I save an email attachement as a tempfile? FYR I am trying to read data from a zipped xls attachment and I don't need both the xls and zip file in the end. Thank you. My code fyr: (Right now I think I am just saving the attachment with a…
1
vote
1 answer

powershell export outlook contacts too slow

I'm exporting Outlook contacts to a .csv file using Powershell. Here are the relevant parts of the PS script: $Outlook = New-Object -comobject Outlook.Application $Contacts = $Outlook.session.GetDefaultFolder(10).items $count =…
mivk
  • 13,452
  • 5
  • 76
  • 69