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

Watermark location is different in word and PDF document in MS interop C#

In my program, there is a function with which users can add watermark to docx or PDF files. Application wordApp = new Application(); wordApp.Visible = false; wordApp.ScreenUpdating = false; Microsoft.Office.Interop.Word.Document wordDoc =…
LFLJM
  • 65
  • 10
2
votes
1 answer

MS Word interop: How much text can fit into a cell

Is it possible to tell how much of a given text can fit into a table cell? This example puts everything in the first cell, I need to split it in two without resizing the first cell or changing the font. using System.IO; using…
Dmitry Fedorkov
  • 4,301
  • 1
  • 21
  • 30
2
votes
0 answers

Crash when using SafeMailItem (fault in mso20win32client.dll)

We use Redemption since many years. Since few days many of our clients have issues when they use our plugin for Outlook. We changed nothing in our app. I did some traces and found that the line Set CourielOutlook = New Redemption.SafeMailItem…
2
votes
3 answers

How can I get the the Microsoft Access Database Application Title via C#

I need to get the Application Title from an access database via C#. I have seen some samples using Office VBA: I.E: https://learn.microsoft.com/en-us/office/vba/api/access.application.apptitle The issue is that I don't have a reference to a class…
2
votes
2 answers

Disable Macros Automatically Microsoft Word Interop

I have a addin in word that on startup tries to use some macros (I presume that's what it's trying to do anyway), and pops up a window that looks similar to I think the issue is that the addin has an expired digital signature, however, I require…
Dan
  • 7,286
  • 6
  • 49
  • 114
2
votes
1 answer

Generate a word document with excel

I've modificated the code following the last advices that I've recived. However I still can't generate the new word document using my VBA code from Excel. I would like that Excel will able to modificate text content and generate a new document that…
Hoppigresi
  • 31
  • 1
2
votes
2 answers

Download outlook attachments with vba according to subject does not work on other computers

The code reads the lines from Excel in column "A", looks for them in Outlook and downloads the attached file to the folder that is in range("E3"), which changes depending on the computer. But, on my computer it works perfectly, on my colleagues'…
2
votes
3 answers

HTML email body with embedded local image

I was trying to automate a email sending process. This email was supposed to have a image on its body. In the code below, I've put the image on the email html body. Since the image path is at my local machine, the recipients would not receive it on…
2
votes
0 answers

Why Office Automation Web App in IIS don't works on Windows Server?

It's about a simple Office (Visio) Automation Web App that convert files from vsdx to svg. The app works well in IIS on my PC- windows 10 Enterprise. But, don't works well in IIS on my server- Windows Server 2019 Standard. Of course, I have tried…
2
votes
1 answer

Rename the Excel Sheet Name in C#

VS 2008 / C#. On passing the File path of a Spreadsheet, i need to rename the Sheet. How to rename the Sheet1 of the Excel Sheet as "ABC". We exporting an Excel Sheet to the SQL Database. Records in the Excel Sheet are manually edited and updated…
goofyui
  • 3,362
  • 20
  • 72
  • 128
2
votes
1 answer

Can't replace the footer text in a word application through Delphi

I am trying to replace text in a footer, I am using the following code through which i can replace the normal content (body) but not the content in the footer/header myWinWordApp := CreateOLEObject('Word.Application'); myWinWordApp.visible :=…
Vijay Bobba
  • 313
  • 4
  • 15
2
votes
2 answers

Extracting excel worksheet into a string in C#

How can i extract excel worksheet into a string using C#? i already have the sheet and can save as txt file but instead of that I want to extract it into a string directly and do some processing.
ns12345
  • 3,079
  • 5
  • 41
  • 62
2
votes
1 answer

How to Find and Close an open Office document via Office Automation

I have a program that will take the files in a directory and upload them to a server. If the file is a Word File, I would then like to detect if the file is open in word / excel etc. If it is open, I would like to be able to then close it, in…
Dave Stringer
  • 349
  • 4
  • 15
2
votes
0 answers

Insert bulleted text in Powerpoint using Open XML C#

I am creating one slide PowerPoint file using open XML. I have tagged the placeholder in the PPT which i need to update programatically. I am able to find the placeholder and can update its value from the database. Now the problem is I need to…
Rohit daga
  • 71
  • 8
2
votes
2 answers

C# converting a VBA macro to C# with custom RGB color

In converting a VBA macro to a plugin coded in C#, I have run into the following impasse. The original VBA code is: Selection.Font.Name = "Times New Roman" Selection.Font.Size = 14 Selection.Font.Bold = True Selection.Font.BoldBi =…
ib11
  • 2,530
  • 3
  • 22
  • 55