Click here to Skip to main content
16,004,678 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,
I am just trying to develop a code in c or c# that will create a custom property to a file I've used OleDocumentProperties and it is successfully adding the properties also but as I copy that file the properties got vanished.

the sample code are here If you want please suggest some other code :
OleDocumentProperties oOleDocumentProperties = new OleDocumentProperties();
           oOleDocumentProperties.Open(@"C:\Users\test\yrdy\mbam.exe", false, DSOFile.dsoFileOpenOptions.dsoOptionDefault);
           DSOFile.CustomProperty test;
           DSOFile.SummaryProperties summaryProperties;
           oOleDocumentProperties.SummaryProperties.Title = "diggisx";
           object obj = "test";
           //oOleDocumentProperties.CustomProperties.Add("Digvijay", ref obj);
           //oOleDocumentProperties.Save();
           //oOleDocumentProperties.Close(true);
           summaryProperties = oOleDocumentProperties.SummaryProperties;
           Console.WriteLine(summaryProperties.Title);
           //foreach (DSOFile.CustomProperty property in oOleDocumentProperties.CustomProperties)
           //{

           //    Console.WriteLine(string.Format("Value for key \"{0}\": {1} ", property.Name, property.get_Value()));

           //}
           Console.ReadLine();
Posted
Updated 5-May-15 21:54pm
v3
Comments
Andy Lanng 6-May-15 4:36am    
Did all the properties go missing, or just the custom ones?

PS: This is an NTFS tool. If you copy the file to a Fat32 drive for eg, then there are no properties that can be set / read
Member 11460356 6-May-15 4:50am    
I want that property to show in properties tab of a file what to do for that?
Andy Lanng 6-May-15 4:54am    
Question 1: After copying the file, did SummaryProperties.Title vanish?
Question 2: After copying the file, did CustomProperty test vanish?
Question 3: Did ALL properties vanish?
Question 4: Are you copying the file to a different drive, network or local?
Question 5: do you know the file format of that drive (NTFS or FAT32)
Member 11460356 6-May-15 4:57am    
Yes It is vanished. And I want a property to be seen in file property option what to for that can you help me in this??
Andy Lanng 6-May-15 4:58am    
I have no idea if I can help you unless you answer ALL my questions.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900