Solved

Word Ole Automation

Posted on 2001-08-31
6
452 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: Subnet Calculator

The subnet calculator helps you design networks by taking an IP address and network mask and returning information such as network, broadcast address, and host range.

One of a set of tools we're offering 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: Hints for the grid button.  Nested classes, templated collections.  Squash that darned bug! Continuing from the sixth article about sudoku.   Open the project in visual studio. First we will finish with the SUD_SETVALUE messa…
Introduction: Database storage, where is the exe actually on the disc? Playing a game selected randomly (how to generate random numbers).  Error trapping with try..catch to help the code run even if something goes wrong. Continuing from the seve…
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.
There are cases when e.g. an IT administrator wants to have full access and view into selected mailboxes on Exchange server, directly from his own email account in Outlook or Outlook Web Access. This proves useful when for example administrator want…

691 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