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
3
votes
1 answer

Is it possible to automate the Compare Presentations feature of PowerPoint 2010?

Is it possible, either through VBA or interop / VSTO, to automate the "compare presentations" feature of PowerPoint 2010? Simply invoking it would be a start, though ideally I'd like a bit more control - and in the perfect world be able to…
Gary McGill
  • 26,400
  • 25
  • 118
  • 202
3
votes
3 answers

Outlook New Mail Window opened from C# seems to have focus but my app still has it

I'm having a problem that I've been trying to solve for days now, but without luck! On my Windows Forms Application I have a grid. One column contains an email address. When the user double clicks this column, I want to open a new E-Mail Window via…
Andre Kraemer
  • 2,633
  • 1
  • 17
  • 28
3
votes
1 answer

Making a workbook visible

I have the following code: Dim DumpXlApp As Excel.Application = New Excel.Application Dim DumpWkBk As Excel.Workbook DumpWkBk = System.Runtime.InteropServices.Marshal.BindToMoniker(FilePath) DumpXlApp = DumpWkBk.Parent DumpXlApp.Visible = True I…
JoeB
  • 297
  • 4
  • 20
3
votes
1 answer

Automation Errors: 800706B5, 80004005, 80010108 appear for internal SAP site scrape

I am writing a macro that will scrape my company's internal SAP site for vendor information. For several reasons I have to use VBA to do so. However, I cannot figure out why I keep getting these three errors when I attempt to scrape the page. Is it…
derigible
  • 964
  • 5
  • 15
  • 32
3
votes
2 answers

Dynamically adding RibbonButtons in Word Addin throws Collection is readonly

I am fairly new to Word AddIns and trying to add Ribbon Group(s). for each RibbonGroup i dynamically add RibbonMenu and then add RibbonButtons to menu inside a Group. I got the groud work and it seems to be okie but whenever i access any…
WPFKK
  • 1,419
  • 3
  • 20
  • 42
2
votes
1 answer

Create SmartArt from TreeView in C#

Is there a way to create a SmartArt Hierarchy chart in Word from a treeview that the user creates in a C# Windows Forms application? Thanks for any help.
ALUM22
  • 101
  • 1
  • 10
2
votes
3 answers

How to get text from line number in MS Word

Is it possible to get text (line or sentence) from a given line number in MS Word using office automation? I mean its ok if I can get either the text in the given line number or the sentence(s) itself which is a part of that line. I am not providing…
nawfal
  • 70,104
  • 56
  • 326
  • 368
2
votes
2 answers

Change behavior of outlook (Reply and Reply All) itself, to add attachments from the original email to the replied message

As you know while you are using outlook and use (Reply/ Reply All) to an email message, the original attachments is not included on the replied message. So, I have used the below code and assigned to a custom buttons on outlook ribbon, and it works…
Waleed
  • 847
  • 1
  • 4
  • 18
2
votes
1 answer

How to properly initialize win32com.client.constants?

I'm writing a simple email filter to work upon Outlook incoming messages on Windows 10, and seek to code it up in Python using the win32com library, under Anaconda. I also seek to avoid using magic numbers for the "Inbox" as I see in other examples,…
bgoodr
  • 2,744
  • 1
  • 30
  • 51
2
votes
2 answers

Outlook filter support for millisecond component of time when filtering using 'httpemail:datereceived'

I am search Outlook using interop and I'm trying to filter emails based on date & time, including down to milliseconds, but it appears not to be supported. I have the following filter, if I remove the sub-second component it works - it does not…
AwkwardCoder
  • 24,893
  • 27
  • 82
  • 152
2
votes
1 answer

ShellExecute opens a ms word doc as well as restores a minimised word doc

I want to open MS Word docs from my app. I use ShellExecute function to do the job. It does open a word doc that I specified, but it restored a doc that I opened before and minimised, that is not what I want. Also the ShellExecute returns 42 that I…
peter
  • 1,009
  • 3
  • 15
  • 23
2
votes
1 answer

Downloading emails with attachment using Python

Is it possible to download emails from outlook as .msg WITH attachments using Python? I’ve gone down the rabbit hole and I’m pretty sure I can’t but wanted to ask here. I need them in one file and not two separate files.
Wizkidbrz
  • 21
  • 2
2
votes
2 answers

What is the FileType number for PDF in Excel 2007 that is needed to save a file as PDF through the API?

I need to call a function in order to save an Excel workbook. I installed the PDF save addon for Excel 2007 but now I need to know what the number code is for the file format for when I save the excel file. An example of the excel file format…
2
votes
2 answers

how to set an Account object by MailItem.SendUsingAccount when sending an email?

I need to build a program that automatically sign in to Outlook and send an email using the account. The doccument says SendUsingAccount property is available to set an Account object from which a mail is sent, yet it seems not explain how. Please…
tam tem
  • 23
  • 4
2
votes
1 answer

Outlook VBA - .RTFBody Formatting from Byte Array

I am developing a VBA / VSTO script that interacts with Outlook. I have a process that should, essentially, do this: Read in an .oft file that is in Rich Text Format Parse the RTFBody array into a String Replace some elements of the String (so a…
RFarrar
  • 21
  • 2