Home |
Search |
Today's Posts |
#1
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
I am writing Word Automation Code in C++ and I want to convert the strings
below to a table using the parameter "wdSeparateByCommas", but it throws a exception ,the error code is 4608. But when I copy these strings into word and do the convertion by menus, word just do very well, can anybody help me? The strings : description,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0 0,,1200.00,0.00,100.95,1200.00,0.00,0.00,0.00,0.00 ,,1342.23,23.71,100.95,1338.21,-5.51,28.48,-5.51,5.00,,1552.57,23.71,100.95,1530.80,-21.57,111.50,-21.57,0.00,,2232.51,91.00,300.00,2000.17,199.79,-134.73,199.79,5.00,,2242.51,91.00,300.00,2000.00,2 04.79,-143.39,204.79,0.00,,2273.10,90.00,305.00,1999.73,2 21.22,-169.18,221.22,5.00,,5600.00,90.00,305.00,1999.73,2 129.45,-2894.42,2129.45,0.00 |
#2
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Hi Benny,
I'm surprised Word lets you convert those strings to a table. Doing so would require a 72-column table, but the column limit in Word (at least up to Word 2000) is 63. Cheers -- macropod [MVP - Microsoft Word] "Benny" wrote in message ... I am writing Word Automation Code in C++ and I want to convert the strings below to a table using the parameter "wdSeparateByCommas", but it throws a exception ,the error code is 4608. But when I copy these strings into word and do the convertion by menus, word just do very well, can anybody help me? The strings : description,0.00,0.00,0.00,0.00,0.00,0.00,0.00,0.0 0,,1200.00,0.00,100.95,120 0.00,0.00,0.00,0.00,0.00,,1342.23,23.71,100.95,133 8.21,-5.51,28.48,-5.51,5.0 0,,1552.57,23.71,100.95,1530.80,-21.57,111.50,-21.57,0.00,,2232.51,91.00,300 ..00,2000.17,199.79,-134.73,199.79,5.00,,2242.51,91.00,300.00,2000.00,2 04.79, -143.39,204.79,0.00,,2273.10,90.00,305.00,1999.73,2 21.22,-169.18,221.22,5.00 ,,5600.00,90.00,305.00,1999.73,2129.45,-2894.42,2129.45,0.00 |
#3
![]()
Posted to microsoft.public.word.tables
|
|||
|
|||
![]()
Thank you macropod,
I have also set the other parameters: NumRows = 8 NumColumns = 9 InitialColumnWidth = 28 and in word I also specify the numbers of Rows and Columns,so word just do very well and my program catch a exception. since I must write the code in c++ and this means i must specify all the parameters , the source code list below: CString strTableText; strTableText = GetTableTitleString(); //this function return the strings m_Selection.TypeText((LPCTSTR)strTableText); m_Paragraphs = m_Document.GetParagraphs(); m_Paragraph = m_Paragraphs.GetLast(); m_Range = m_Paragraph.GetRange(); m_Range.Select(); try { m_Table = m_Selection.ConvertToTable(OLESHORT(wdSeparateByCo mmas), OLESHORT(myReportData.keyNodeCount + 2), OLESHORT(totalColumnCount), OLESHORT(28), OLESHORT(wdTableFormatNone), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLEBOOL(TRUE), OLESHORT(wdAutoFitContent), OLESHORT(wdWord9TableBehavior)); } catch (COleDispatchException* pException) { CString strException; strException += "Exception Program\t:" + pException-m_strSource + "\n\n"; strException += "Exception Description\t:" + pException-m_strDescription + "\n\n"; strException += "Exception HelpFile\t:" + pException-m_strHelpFile + "\n\n"; MessageBox(NULL,_T(LPCTSTR(strException)),_T("Exce ption Error"),MB_OK); exceptionOccur = true; goto WordExceptionError; } |
Reply |
Thread Tools | |
Display Modes | |
|
|
![]() |
||||
Thread | Forum | |||
"paste" function failure in MS Word | Page Layout | |||
How to overwrite shortcut keys function in word | Microsoft Word Help | |||
Text to Speech Function is available in Excel but not in Word | Microsoft Word Help | |||
VBA function results in fields | Microsoft Word Help | |||
Word Compare and Merge Document Function | Microsoft Word Help |