![]() |
![]() | ![]() | ![]() | ![]() | ![]() | ![]() | ![]() |
| Welcome to Windows Vista Forums. Our forum is dedicated to helping you find solutions with any problems, errors or issues you are experiencing with Windows Vista. The Vista forum also covers news and updates and has an extensive Windows Vista tutorial section that covers a wide range of tips and tricks. |
| |||||||
![]() |
| |
| | #1 (permalink) |
| | Word Automation on Custom Properties 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 |
My System Specs![]() |
![]() |
| Thread Tools | |
| |
Similar Threads | ||||
| Thread | Forum | |||
| Word Properties Automation | .NET General | |||
| Accessing Word document properties | PowerShell | |||
| Custom properties on a folder | Vista General | |||
| Viewing custom file properties? | Vista General | |||
| Info: Can you create your own objects with custom properties. | PowerShell | |||