How to Delete an Object from a DOCX Document in C#

Simplifying your online editing process is a huge time-saver, and with the right equipment, it can be as easy as 1–2–3. Once you’ve opened a Word document for modifications with our Begin Editing function, the following process can be used to remove objects (paragraphs, tables, images, etc.) from the text.

Image for post
Image for post

Starting off, we are going to install the .NET Framework SDK (.NET Core available as well):

Install-Package Cloudmersive.APIClient.NET.DocumentAndDataConvert -Version 3.2.8

Next, we will call the remove object function:

using System;
using System.Diagnostics;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Api;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Client;
using Cloudmersive.APIClient.NET.DocumentAndDataConvert.Model;

When the object has been successfully deleted from your document, you can continue to make edits, or use our Finish Editing process to download and save your changes. To retrieve your personal API key and gain access to 800 monthly calls, head to the Cloudmersive website and register for a free account.

There’s an API for that. Cloudmersive is a leader in Highly Scalable Cloud APIs.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store