Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #3   Report Post  
Posted to microsoft.public.word.tables
Benny
 
Posts: n/a
Default can anybody help me in using the function "converttotable"

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;
}

 
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
"paste" function failure in MS Word rhaggard Page Layout 0 April 8th 06 07:54 PM
How to overwrite shortcut keys function in word [email protected] Microsoft Word Help 4 October 7th 05 06:55 PM
Text to Speech Function is available in Excel but not in Word Shrikant Microsoft Word Help 1 August 9th 05 02:32 PM
VBA function results in fields Robert Mulroney Microsoft Word Help 3 July 5th 05 09:03 AM
Word Compare and Merge Document Function EricM Microsoft Word Help 2 March 28th 05 11:53 PM


All times are GMT +1. The time now is 07:14 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"