473,662 Members | 2,637 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.GetTypeFro mProgID("Word.C ustopParopertie s");
System.Object obj = Activator.Creat eInstance(Prop) ;

Microsoft.Offic e.Interop.Word. CustomPropertie s CustomProp = obj
as Microsoft.Offic e.Interop.Word. CustomPropertie s;
foreach (Microsoft.Offi ce.Interop.Word .CustomProperty property
in CustomProp)
{ if (property.Name == valfind) property.Value = valreplace; }

and I get this error

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

Source Error:


Line 53:
Line 54: Type Prop =
Type.GetTypeFro mProgID("Word.C ustopParopertie s");
Line 55: System.Object obj = Activator.Creat eInstance(Prop) ;
Line 56:
Line 57: Microsoft.Offic e.Interop.Word. CustomPropertie s
CustomProp = obj as Microsoft.Offic e.Interop.Word. CustomPropertie s;


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 1147

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

Similar topics

3
2776
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 in c#. Is it possible to do it through xml serialization ? THanks, --Emily *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in USENET...get rewarded for it!
4
12370
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 working but I have run into a problem. The final section of the resume deals with Experience which is subgrouped by Market Segments and then experience. What I want it to look like is
6
3952
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 open all four PPT files at once, and would loop through queriers for ever client and create custom presentations. Now there are 8 files, nearly 500 slides and the computer is bogging down with trying to open them all at once. I know that Access...
4
7672
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 handle the automation. So, i'm using the following code to create a new word document: ---Code---
4
3957
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 late binding. If I use early binding, my code runs fine on most systems, but it is vulnerable to a known bug explained here: http://support.microsoft.com/default.aspx?scid=kb;en-us;292744
3
5604
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 DocumentProperties, but I get an invalid cast exception. In Explorer, I can right click a Word document, click Properties, and I get a tabbed dialog with Custom and Summary tabs. These tabs show me the built in document properties of the document. ...
4
3691
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 machines this works fast and nice, but on the Word 2003 machines it takes 5-10 times longer. Is there a way to make Word 2003 clients to work faster? Recently a warning message, showed up in the error list: "There are updated custom wrappers...
0
938
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"); System.Object obj = Activator.CreateInstance(Prop); Microsoft.Office.Interop.Word.CustomProperties CustomProp = obj as Microsoft.Office.Interop.Word.CustomProperties;
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 = Type.GetTypeFromProgID("Word.CustopParoperties"); System.Object obj = Activator.CreateInstance(Prop); Microsoft.Office.Interop.Word.CustomProperties CustomProp = obj as Microsoft.Office.Interop.Word.CustomProperties;
0
8435
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8345
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
8857
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
8768
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
7368
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6186
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5655
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4181
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 last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
2
1999
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.