473,386 Members | 1,860 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Word document custom properties

How do I check if the Word document custom property exists?

And how to remove it?

object customProps = wordDoc.CustomDocumentProperties;

Type typeCustomProps = customProps.GetType();

object[] args =

{"CompanyName",

false,

Microsoft.Office.Core.MsoDocProperties.msoProperty TypeString,

"Microsoft Corporation"};

// I know how to add the property by

typeCustomProps.InvokeMember("Add",

BindingFlags.Default | BindingFlags.InvokeMethod,

null,

customProps,

args);

But I want to check if it exists then delete it, and then add it back?
Nov 7 '06 #1
0 1481

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ken | last post by:
Hi, I've written a C# app in VS .Net 2003 that gets and sets custom/summary properties of Word documents by selecting a directory and get/setting values using BuiltInDocumentProperties and...
3
by: Emily John | last post by:
I have a word document that I need to send it as an attachment to an XML file. Basically, converting into byte array or using some encoding mechanism. This has to be done through XML serialization...
41
by: Ruby Tuesday | last post by:
Hi, I was wondering if expert can give me some lite to convert my word table into access database. Note: within each cell of my word table(s), some has multi-line data in it. In addition, there...
8
by: Asma | last post by:
Dear Sir, I am trying to find a way to open a Word document using C language and read the text of word doc into a variable. (Turbo C on Dos 6.0). Can anyone please tell me which libraries in...
1
by: Darin | last post by:
I would like to check if a document is a Word document. I'm currently just checking for the "doc" extension but the extension can be changed so that's no good. Any examples or guidance on how...
12
by: Rob Nicholson | last post by:
We've implemented functionality to allow a user to download a document (any document type) from the IIS server using the following code: Response.Clear() Response.ContentType =...
3
by: Charles Law | last post by:
Word has a property BuiltinDocumentProperties, which (in VBA) returns a DocumentProperties collection. In VB.NET, using Word automation, it returns a _ComObject. I have tried to cast this to...
0
by: Alan T | last post by:
I have modified custom properties of a Word document by code. And there are fields in this Word document link to the properties, however, after running the application and reopen the document, the...
0
by: Probi | last post by:
Hi, I´m trying to make word automation on document custom properties(for a given property name change the value) I put this code together: Type Prop =...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.