|
#1
|
|||
|
|||
|
Word Application using C++
Hello Friends,
I am facing one problem While writing code for opening one word document using C++ Code,I am getting exception at the highlighted code.If I use any other word API then also I am getting exception.Is their anything else which I have to initialize to getting it work smoothly or I am missing something . Can anyone Help me on this? ::CoInitialize(NULL); using namespace Word; _ApplicationPtr word=NULL; _DocumentPtr vk_my_doc = NULL; _DocumentPtr vk_new_doc = NULL; // create application object word=_ApplicationPtr(__uuidof(Application)); word->Visible = true; word->raw_Activate(); VARIANT v1 ; v1.vt = VT_BSTR; v1.bstrVal = ::SysAllocString(L"C:\\test.doc"); word->Documents->Open(&v1); //vk_new_doc = word->Documents->Add(); ::CoUninitialize(); Regards Shilpi Gupta |
|
#2
|
||||
|
||||
|
__________________
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section. ![]() Please use [Code]your code goes in here[/Code] tags when posting code. Before posting your question, did you look here? Got a question on Linux? Visit our Linux sister site. Modifications Required For VB6 Apps To Work On Vista ![]() Microsoft MVP 2005/2006/2007/2008/2009 |
|
#3
|
|||
|
|||
|
Problem Solved
Hi,
Thanks, The problem is solved . In office 2007 the extension of the file should be docx not only doc.Now It is working fine and opening the document. Regards Shilpi Gupta Thanks for the links |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Database driven application on Cell Phones | Adam | Mobile | 2 | 09-26-2005 12:35 PM |
| rmi problem passing object from server class to application | jbste | Java | 0 | 06-15-2005 08:31 PM |
| Inventory Management Application Using VB | Krishna | vb.announcements | 0 | 11-26-2002 12:03 AM |
| Search for MS Word (Parents and child window) | Sasha Polinskaya | VB Classic | 21 | 02-15-2002 08:05 PM |