Office automation question
-
To all specialists, i wrote a MFC programm which starts Microsoft Word, creates a document, adds a table to the document and saves the document. I used the msword9.olb to add the needed classes to my project. The only thing that bothers me is that i have to find out what values to pass to function by "try and error". For example i want to create a table with the autofitbehavior set to "FitToContent". The tables.add function is defined as: Tables::Add(LPDISPATCH Range, long NumRows, long NumColums, Variant* DefaultTableBehavior, Variant* AutoFitBehavior) What value does this function expect in "AutoFitBehavior" to set the table to "FitToContent"? As i said, i fond out by "Try and error". But there must be a better way because there are a lot of functions where this approach will definitely not work. If anybody knows where to find some documentation like: "Set AutoFitBehavior to '2' to get 'FitToContent'" i would be glad if he could let me know. Thanks in advance.