Home |
Search |
Today's Posts |
|
#1
![]()
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 |