Solved

Word Ole Automation

Posted on 2001-08-31
6
438 Views
Last Modified: 2013-11-20
Hi,

I am embedding MSWord In my application, using OLE automation.

But when I goto save i get the saveas method is not available as the document is been editted in another application.

Code As Follows, from the CanCloseFrame() - In My Document Object


CEmbedWordCntrItem* ViewObj;

ViewObj = ((CEmbedWordView*)pFrame->GetActiveView())
                                   - >m_pSelection;
LPDISPATCH lpDispatch = (ViewObj->GetIDispatch());

_Document doc;
doc.AttachDispatch(lpDispatch);
     

COleVariant covFalse((short)FALSE);
COleVariant vtOptional((long)DISP_E_PARAMNOTFOUND,VT_ERROR);


doc.SaveAs(COleVariant("C:\\DataDoc.doc",VT_BSTR), vtOptional.........)

               
Cheers

Richard
0
Comment
Question by:Johnch
  • 3
6 Comments
 
LVL 6

Expert Comment

by:Triskelion
ID: 6462602
Do you need to release control before this happens?
...like...
   app.SetVisible(TRUE);
   app.SetUserControl(TRUE);      
0
 
LVL 1

Accepted Solution

by:
Johnch earned 0 total points
ID: 6463282
Ended up query interfacing for IPersistFile which impletents a suitable save method.
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6466316
Hmmm...
0
 
LVL 6

Expert Comment

by:Triskelion
ID: 6484043
Well... Are you going to delete this question?
0
 
LVL 23

Expert Comment

by:Roshan Davis
ID: 9531970
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

PAQ'd and pts refunded

Please leave any comments here within the next seven days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

Roshan Davis
EE Cleanup Volunteer
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Introduction: Dialogs (2) modeless dialog and a worker thread.  Handling data shared between threads.  Recursive functions. Continuing from the tenth article about sudoku.   Last article we worked with a modal dialog to help maintain informat…
Exception Handling is in the core of any application that is able to dignify its name. In this article, I'll guide you through the process of writing a DRY (Don't Repeat Yourself) Exception Handling mechanism, using Aspect Oriented Programming.
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…

747 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now