WinAsm Studio, The Assembly IDE - Free Downloads, Source Code
Sponsors
Articles
Programming Quick Start
32-bit Assembler is Easy
Porting Iczelion tutorials
What is FASM
Hard Drive Recovery
Wiring your own LAN
Personal menu
Welcome Guest
User:
Pass:
Register!
Resend Validation Email
 
Forum
 

Word Application Using C++, Getting Exception in following CODE

shilpi_gupta0708
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 27623
Joined: 12-October 09


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
PMEmail Poster
Top
shilpi_gupta0708
Quote Post


New Member
*

Group: Members
Posts: 4
Member No.: 27623
Joined: 12-October 09


Hi,

The problem is solved . In office 2007 the extension of the file should as docx not only doc.

Regards
Shilpi Gupta

PMEmail Poster
Top
chrisadam12
Quote Post


New Member
*

Group: Members
Posts: 2
Member No.: 37866
Joined: 16-September 10


This is very confusing to what you are trying to achieve. If you are looking to get the Text content from a word document there are a number of ways of achieving this but it depends on how and what calling application you are using. IFilters are used to
provide word breakers and support for the Search Server to be able to use foreign documents to be extracted with content, this content is not normally filtered and will contain a number of additional streams of information.

If you wish to use Word and you are using a Server process this is not a good way of implementing a word stripper and the IFilter process would be the better way to go. The Application Is Busy could be raised by a number of things, it would be useful to
appreciate the specific document format are you running inside of the word process or calling the Word COM Object model from an external program.





__________________________________________________



Want to get-on Google's first page and loads of traffic to your website? Hire a SEO Specialist from Ocean Groups [url= http://oceangroups.org/]seo pecialist [/url]
PMEmail Poster
Top
1 User(s) are reading this topic (1 Guests and 0 Anonymous Users)
0 Members:

Topic Options Reply to this topicStart new topicStart Poll

 

Sponsors
Computer Science

Internet
C/C++
Hardware & PC maintenance

HiEditor

General Discussions
Suggestions/Bug Reports
WinAsm Studio

General Discussions
Suggestions/Bug Reports
WinAsm Studio FAQ
Multilingual User Interface
Add-Ins
Assembly Programming

Main
Newbies
Projects
Custom Controls
Snippets
Announcements & Rules

Announcements

General

Online Degrees - Distance Learning
The Heap
Russian
Google