Solved

Word Ole Automation

Posted on 2001-08-31
6
450 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

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 …
If you use Adobe Reader X it is possible you can't open OLE PDF documents in the standard. The reason is the 'save box mode' in adobe reader X. Many people think the protected Mode of adobe reader x is only to stop the write access. But this fe…
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.
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

739 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