3,652 questions
0
votes
2
answers
64
views
C# WinForms timer is stuck/hangs while creating my Office.Interop.PowerPoint
Creating PowerPoint presentations in C# Visual Studio, I realized that my WinForm timer hangs; I can't even move my Application around the screen. Is there a way to create my PowerPoint in the ...
0
votes
2
answers
26
views
Property not supported exception
I am trying to get the AppointmentRecur property (PT_BINARY) of an Outlook 2007 appointment using this DASL: http://schemas.microsoft.com/mapi/id/{00062002-0000-0000-C000-000000000046}/82160102 with ...
0
votes
1
answer
26
views
Monitoring all sent items folders in add in
So I have an add in that monitors the sent items folder and uploads emails to an azure storage when a new item hits it, if it meets certain criteria.
my issue is that it only works on the default ...
0
votes
0
answers
44
views
Check whether two Word tables are under the same heading
I am using Microsoft Office Interop Word in C# to edit word files. Is there a way to check the tables are under same heading?
My End goal is to delete an empty table from Word Document. That is - if ...
0
votes
1
answer
69
views
how to open Excel and show data from C# without using a disk file?
What I have is an Excel document created by ClosedXML which I can write to a perfectly valid XLSX file. However, what I am looking for is to show the document in Excel without writing it to a disk ...
0
votes
1
answer
28
views
Re-encrypting a mailitem using property accessor
I need to decrypt a mailitem, save it as .msg, then re-encrypt it, so the original mail seems unaltered.
OUTLOOK VSTO ADDIN C#
// Decrypt the mail item
const string PR_SECURITY_FLAGS = "http://...
1
vote
1
answer
55
views
How to create a Word Doc Footer with multiple font/color styles using Vb.net
I'm trying to create a word doc Footer programmatically in vb.net that has 3 lines or more with 3 different font colors and font styles. I can only seem to get the first color and style to ‘stick’ the ...
2
votes
0
answers
45
views
How can I tell whether or not user has the new MS Office visual style?
I make a c# add-in for an MS Office desktop app. It uses WPF for front end UI. I want the background of the forms in the add-in to match the Office app colors.
Microsoft recently launched a brand-new ...
0
votes
1
answer
55
views
Using Outlook Interop : Could not load file or assembly 'office
In my winforms .NET Core project, i'd like to create a mail in Outlook.
Dim outlookApp As Outlook.Application = New Outlook.Application()
Dim mail As Outlook.MailItem = CType(outlookApp.CreateItem(...
0
votes
1
answer
64
views
Outlook Redemption AddPSTStore Error MAPI_E_INTERFACE_NOT_SUPPORTED
I am working with Outlook Nicknames using Redemption for a C# .NET Framework console application. When I attempt to add a PST store with:
RDOPstStore pstStore = rdoSession.Stores.AddPSTStore(@"c:\...
0
votes
1
answer
81
views
Error "The macro may not be available in this service or all macros may be disabled." from C# code that executes a VBA macro
I've written a C# program that uses Excel Interop libraries to open a file and execute a macro.
I've been using this program for quite some time on a server running Windows 2016 and Excel 2016.
Now I'...
0
votes
0
answers
27
views
Extract word content including format and generate image
I find it quite frustrating to use the interop dll for word in my use case. What I am basically trying to achieve is the following: I have an input word document that includes different formats, ...
0
votes
1
answer
79
views
C# clicking button on Excel worksheet
I have developed an Excel workbook that is being used by C# developers. When someone using Excel clicks on one of two OptionButtons, an underlying cell ("B1") value changes (1<->2). ...
0
votes
0
answers
39
views
How to get correct Horizontal Text Boundary
Basically I am implementing a function which check all numbering styles and create same replica but without numbers. This will be used and following paragraph style.
I am able to get all the ...
1
vote
1
answer
34
views
How to set value in Excel footer using Microsoft.Office.Interop.Excel in iManage extension?
I'm building a desktop extensions for iManage work desktop in .NET Framework 4.8 that should be able to set a particular value in the footer of Word, Excel and Powerpoint documents.
I've managed to ...
0
votes
1
answer
21
views
HeaderFooter enumeration fails in VSTO application when processing Compatibility Mode docs
I have created a C# MS Word VSTO add-in in Visual Studio 2022 that loops through the footers in documents and injects a text box and field code into the footers of different sections. This code works ...
0
votes
0
answers
23
views
Repurposing of Office commands not working
I'm trying to repurpose a built-in command using the following XML, but it doesn't appear to be call the onAction callback function:
<?xml version="1.0" encoding="UTF-8"?>
&...
0
votes
1
answer
267
views
Microsoft.Office.Interop.Excel has different methods for .NET Core and .NET framework?
I am attempting to upgrade dependencies like Microsoft.Office.Interop.Excel and migrate my application from .NET Framework to .NET Core.
However, it seems that this upgrade involves extensive code ...
0
votes
1
answer
88
views
Unable to cast COM object of type Outlook in vb.net
In my VB.Net WinForms Application which is upgraded from framework 1.1 to 4.7 (Visual Studio 2022, Framework 4.7), I am using Outlook interope dll to send mails.
These are the dlls that i have added ...
0
votes
0
answers
35
views
Office Interop: Cancellation
Let's say I want to convert a PowerPoint file to a PDF file using Office Interop:
using Microsoft.Office.Core;
using Microsoft.Office.Interop.PowerPoint;
Application app = null;
try
{
app = new ...
0
votes
1
answer
87
views
Copying format restarts a custom undo record
I'm developing a Word add-in using VSTO and faced an issue with a custom UndoRecord. The problem appears when I use the CopyFormat method between the StartCustomRecord and EndCustomRecord method calls....
1
vote
0
answers
143
views
Understanding COM Errors with Microsoft.Office.Interop.Excel on Different Build Platforms in .NET Framework 4.7.2
I have .net framework 4.7.2 project which is using that uses Microsoft.Office.Interop.Excel nuget which is giving error in Office 2021 version.
Unable to cast COM object of type 'Microsoft.Office....
0
votes
0
answers
20
views
Formatting of document along with headers and footers removed after adding new text programatically
I have an original doc file and here I am replacing some texts using microsoft.interop.word.
After replacing the text I have to add additional text in the doc file after specific location.For this I ...
0
votes
0
answers
17
views
Interop Word AddPicture not adding after a few already in
I am creating a Word file with a table and several rows, in some of which I add text and images.
Now, the problem I am facing is that after some images, the AddPicture method returns a null ...
0
votes
0
answers
67
views
I am using C# to display results in Excel. Its showing Compile Error CS1061
Code will open a new Excel file (visible = False) and data will be entered then the Excel file will be made visible (visible = True).
using oExcel = Microsoft.Office.Interop.Excel;
private void ...
0
votes
0
answers
33
views
Set an excel cell/range formula which contains quotation mark error. (0x800A03EC))
I use interop.excel library.
I want to set this string to the formula of some excel range: =HA(VAGY(C2="83V";C2="8U";C2="9V");"nem";"igen")
English: =...
0
votes
0
answers
57
views
Why does my script's output change when run manually vs via task scheduler
While my script runs both ways, when run through task scheduler, it messes up on an if-else statement. It's supposed to send out an email when it detects that there are fewer than three objects in a ...
0
votes
0
answers
108
views
MS Office Interop Word: How to merge multiple documents and have them include the original footer?
I'm a beginner trying to code a program that would merge all the Word documents in a single directory and combine them altogether into a giant one.
The code I've so far looks like this:
foreach (...
1
vote
0
answers
58
views
VSTO Binding redirect not working in Excel Addin deployed
We are working in a VSTO Addin Excel project, with many dependencies references.
We also have an Setup Project for create installer for this project.
When we deploy the project using the installer the ...
0
votes
1
answer
131
views
Add audio to presentation programmatically slide and auto play
I want to add a prerecorded mp3 to a presentation slide and play it when the slide is shown. This is my code, but it does not play audio at all. How to use OpenXML and add audio files to a ...
1
vote
0
answers
64
views
Error when updating empty content type properties via CustomXmlParts
Im currently developing a VSTO Word AddIn in C#.
Properties that come from SharePoint (ContentTypeProperties) are stored in a customXmlPart with this namespace Uri: "http://schemas.microsoft.com/...
0
votes
1
answer
39
views
VSTO Outlook: HOWTO determine if the MailItem comes from a file saved previously in local and then open in Outlook
I have an Outlook VSTO add-in and I need to determine if the Outlook.MailItem being processed corresponds to a saved file on the local disk that has been opened in Outlook, regardless of the type of ...
0
votes
1
answer
104
views
Excel Interop error on opening .xlsx file Server execution failed (Exception from HRESULT: 0x80080005 (CO_E_SERVER_EXEC_FAILURE))
I have C# batch process Opening, Calculating and Closing many Excel workbooks. After a varying number of iterations, when I try to open the next workbook, I get the below error.
Retrieving the COM ...
0
votes
1
answer
40
views
I was able to display the page numbers of the Word file created by my software. But I can't show it exactly where I want
this is my code:
' Add a new paragraph to the third cell in the first row of the table for the ReviewDate value
Dim newParagraph7 As Word.Paragraph = oTableHeader.Cell(1, 3)....
1
vote
1
answer
52
views
Word Interop change text of paragraph before a table
I want to change the text af a paragraph. Thought it is totally simple - until there was a table.
Actually it is just one line of code:
activeDocument.Paragraphs[2].Range.Text = "abcd" + &...
1
vote
1
answer
126
views
Correct library for Microsoft.Office.Interop.MSProject in .Net core 8
Previously, I used Microsoft.Office.Interop.MSProject with a .NET 4.8 project, but now I have upgraded that project to .NET Core 8. What is the library that supports MSProject?
I want to use MSProject ...
0
votes
0
answers
93
views
Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IHostItemFactoryNoMAF'
Exception Message: Unable to cast COM object of type 'System.__ComObject' to interface type 'Microsoft.VisualStudio.Tools.Office.Runtime.Interop.IHostItemFactoryNoMAF'. This operation failed because ...
0
votes
0
answers
56
views
Get vertical cells of a range object
How can I get the cells of a column (only vertical cells) in a Word table?
Note:
I am not interessted in all the cells of a column, there for I can't seem to use .Column.Cells because I would like to ...
0
votes
1
answer
125
views
Find email-enabled public folders exclusively using "Microsoft.Office.Interop.Outlook"
Is there a way to exclusively identify email-enabled public folders using Microsoft.Office.Interop.Outlook? EWS or PowerShell should not be used. The program should run on the workstation and utilize ...
0
votes
0
answers
38
views
Document.Shapes.Count always returns 0, although I added a Shape (TextBox) (and I can see it)
I am fighting with a strange problem, I hope someone can help me.
Here is the scenario: I am writing an Excel Vsto Add-In, which transfers some data from an Excel Worksheet to a Word document. Some of ...
2
votes
0
answers
112
views
OneNote COM Add-In Not Loading - Runtime Error occured during the loading of the COM Add-In
I am developing a COM Add-In for OneNote for Microsoft Office 365 MSO using this project(VanillaAddIn) as a template. However, when I build and install the project, I get the following error when I ...
2
votes
0
answers
106
views
Outlook Redemption - How to modify autocomplete list on outlook 2016 and up
I am working on an issue where a client is changing their domain name for all of their email accounts. I would like to modify all the auto complete records for all of the companies outlook accounts ...
0
votes
1
answer
22
views
Prevent insert graph within a table with interop word c#
I'm trying to create a document word from scratch with a string, a table and a graph using interop c# word.
Now, I've this code :
object start = 0;
object end = 0;
MSWord.Range ...
0
votes
1
answer
117
views
Change direction of cross-functional flowchart
Using C# and Microsoft Interop Office Visio, I am trying to change the direction of a cross-functional flowchart.
To do this manually, I have to do the following:
click on cross-functional flowchart ...
1
vote
0
answers
54
views
How do I late bind excel in vb project targeting .Net 7.0?
I have to late bind to excel for a project because the project will be used in an environment with users utilizing several different versions of Office. In VB projects targeting .Net Framework (say, 4....
0
votes
0
answers
16
views
Microsoft.Office.Interop is showing a login dialog for a file having a private template but after closing the dialog convert without issue
I have an application that utilizes Microsoft.Office.Interop.Word to access .docx files and convert them into .txt format. The application functions smoothly with most .docx files, except for one ...
0
votes
1
answer
951
views
How to automate Office Word from a .Net 8 C# Console application
I am trying to automate Office Word from a .Net 8 Console application.
This is my code:
internal class Program
{
static void Main(string[] args)
{
var appWord = new ...
0
votes
0
answers
27
views
Microsoft.Office.Interop is showing login dialog for a file but not for others
I've developed an application that utilizes Microsoft.Office.Interop.Word to access .docx files and convert them into .txt format. The application functions smoothly with most .docx files, except for ...
0
votes
0
answers
165
views
COM Error while accessing Office 365 EXCEL from code
I am getting the following error when using Office Interop to access excel from office365.
Retrieving the COM class factory for component with CLSID {00024500-0000-0000-C000-000000000046} failed due ...
0
votes
0
answers
76
views
How to subscribe to the Workbook.SheetActivate event?
I want to subscribe to the Workbook.SheetActivate event of my excel Application which I use as a dynamic object so that I am not dependent on the specific version.
Instantiation and EventHandler:
...