Managed C++ and Word tables.

K

Kal

Hello.

The code is below. I can set the call value to Hello however I can't seem to
read to be able to read the value back.

any ideas ?

// create objects of word and document.
Word::ApplicationClass ^ oWord = gcnew Word::ApplicationClass();

//init document
Word::DocumentClass ^ oWordDoc = gcnew Word::DocumentClass();

// make word visable.
oWord->Visible = true;

// create new document.
Object ^ file = "c:\\bill template.doc";
Object ^ missing = System::Reflection::Missing::Value;
Object ^ readOnly = false;
Object ^ isVisible = true;
Object ^ oFalse = false;
oWordDoc =
dynamic_cast<Word::DocumentClass^>(oWord->Documents->Add(file,missing,missing,isVisible));

Word::Range ^ h = oWord->Selection->Range;

Word::Table ^ tab1 =
oWord->Selection->Tables->Add(h,10,3,System::Reflection::Missing::Value,System::Reflection::Missing::Value);

tab1->Cell(1,1)->Select();
oWord->Selection->TypeText("Hello");

// I can seem to be able to read the hello value back.

Thanks for your help
Kalpesh Modha
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top