Is it possible to turn an object to an array in VB.net?
I have a object from outlook which is a mailitem, and I want to turn all the variables into an array to store in a file.
I know Ill loose the functionality of the object (such as move, copy etc) however i only want to store all the information in the object (in this case mailID, recipents etc).
Usually I could just count the elements and then copy the values one at a time, however the mailitem is a nested array inside a nested array inside a nested array so could be quite confusing.
Any ideas?
yes, that's possible. you may want to consider to store it in a List(Of T) or look into the ToArray() method
List(Of T) Class
https://msdn.microsoft.com/en-us/library/6sh2ey19(v=vs.110).aspx
(look for the possible constructors and click on it to see the examples)
List<T>.ToArray Method ()
https://msdn.microsoft.com/en-us/library/x303t819(v=vs.110).aspx?cs-save-lang=1&cs-lang=vb#code-snippet-1