Accessing table field properties such as "TextAlign" in Microsoft Access 2013

May 20, 2014 at 2:01 PM
Edited May 22, 2014 at 11:44 AM
Much thanks to the creator and everyone who has made this project possible. It has definitely made things a lot more organized and easier when dealing with the Microsoft.Office.Interop libraries.

I have a question concerning the use of a field property. The following code would normally just work under the Microsoft.Office.Interop.Access and Microsoft.Office.Interop.Dao namespaces.
// open database

Application app = new Application()
Database db = app.DBEngine.Workspaces[0].OpenDatabase(filePath);
TableDef myTable = db.TableDefs[tableName];
Field myField = myTable.Fields["FirstName"];
Properties myProperties = myField.Properties;   //I get 39 properties for myField
Property fieldTextAlign = myProperties["TextAlign"];
var value = fieldTextAlign .Value;
Currently when I look at the Properties and Property Class in NetOffice, I get an error:
  1. base = {"Class not exists: NetOffice.AccessApi.Property"}
Microsoft intellisense shows that Properties is in the NetOffice.DAOApi namespace even though my original application object (app) belongs in the AccessApi namespace. How do I access these properties. I tried casting but could not make it work. Any help greatly appreciated.

May 21, 2014 at 8:00 PM
in which codeline occurs the problem? (its not clearly for me)
please me let me know also your NetOffice version and your current office version.
(I need this to reproduce your scenario and give you some hotfix tips until i pin point the problem)

May 22, 2014 at 1:50 PM
Edited May 22, 2014 at 2:18 PM
Hi Sebastian,

Thank you for your time and for looking into this issue. I am using NetOffice and Microsoft Office 2013. Basically I am trying to get the value of "TextAlign", "Caption", and "Description" properties from a table field in Microsoft Access. Do you have any examples of getting the values of these properties from a table field?

Thank you.