473,507 Members | 2,476 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Word Automation on Custom Properties

5 New Member
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 = Type.GetTypeFromProgID("Word.CustopParoperties");
System.Object obj = Activator.CreateInstance(Prop);

Microsoft.Office.Interop.Word.CustomProperties CustomProp = obj
as Microsoft.Office.Interop.Word.CustomProperties;
foreach (Microsoft.Office.Interop.Word.CustomProperty property
in CustomProp)
{ if (property.Name == valfind) property.Value = valreplace; }

and I get this error

Exception Details: System.ArgumentNullException: Value cannot be null.
Parameter name: type

Source Error:


Line 53:
Line 54: Type Prop =
Type.GetTypeFromProgID("Word.CustopParoperties");
Line 55: System.Object obj = Activator.CreateInstance(Prop);
Line 56:
Line 57: Microsoft.Office.Interop.Word.CustomProperties
CustomProp = obj as Microsoft.Office.Interop.Word.CustomProperties;


As I understand I dont have the ProgID right
any ideas what should be there
I´m quite new to this and running out of hope

Thanks
Apr 24 '08 #1
0 1140

Sign in to post your reply or Sign up for a free account.

Similar topics

3
2770
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...
4
12361
by: Tom Dauria | last post by:
What I am trying to do is write a resume into a word document from information in an Access database. I have been using bookmarks and inserting table results into the document and so far it's...
6
3936
by: Colleyville Alan | last post by:
I have an application that has an Access table that stores the locations of slides in a Powerpoint file. This used to work fine when there were about 4 files and 200 slides. The database would...
4
7644
by: Daniel | last post by:
Hello, i have a problem with the word automation from c#. First, i want to mention, that i don't have any dependencies from word in my c#-project, i want to use the system.reflection model to...
4
3943
by: Bill Coan | last post by:
NOTE: This was posted earlier to vsnet.vstools.office under a different subject line but received no response. I'm having a problem automating Word's Find object from a .NET application, using...
3
5594
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...
4
3682
by: JensB | last post by:
I have VB.Net VS2005 App which creates MS Word documents. Clients are using Word 2000 and Word2003. Project refers to MS Word 9.0 Object library, declaring Word as an object. On the Word 2000...
0
925
by: =?Utf-8?B?UHJvYmk=?= | last post by:
I´m trying to do some Word Automation in C# in the Custom Properties so far found very few ways to do that I made the following : Type Prop = Type.GetTypeFromProgID("Word.CustopParoperties");...
0
201
by: =?Utf-8?B?UHJvYmk=?= | 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
7223
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
7377
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...
1
7034
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
7488
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5623
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
5045
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4702
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3191
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3179
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?

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.