Go Premium for a chance to win a PS4. Enter to Win

x
?
Solved

Word Ole Automation

Posted on 2001-08-31
6
Medium Priority
?
475 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

New feature and membership benefit!

New feature! Upgrade and increase expert visibility of your issues with Priority Questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction: Load and Save to file, Document-View interaction inside the SDI. Continuing from the second article about sudoku.   Open the project in visual studio. From the class view select CSudokuDoc and double click to open the header …
Introduction: Dialogs (1) modal - maintaining the database. Continuing from the ninth article about sudoku.   You might have heard of modal and modeless dialogs.  Here with this Sudoku application will we use one of each type: a modal dialog …
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.
Despite its rising prevalence in the business world, "the cloud" is still misunderstood. Some companies still believe common misconceptions about lack of security in cloud solutions and many misuses of cloud storage options still occur every day. …
Suggested Courses

971 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