Solved

Word Ole Automation

Posted on 2001-08-31
6
446 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

ScreenConnect 6.0 Free Trial

At ScreenConnect, partner feedback doesn't fall on deaf ears. We collected partner suggestions off of their virtual wish list and transformed them into one game-changing release: ScreenConnect 6.0. Explore all of the extras and enhancements for yourself!

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Different colored text in ComboBox without Subclassing 8 61
java ^ examples 8 66
Making an alias 7 95
"Black Box" Testing of Control System Software 2 51
Introduction: Finishing the grid – keyboard support for arrow keys to manoeuvre, entering the numbers.  The PreTranslateMessage function is to be used to intercept and respond to keyboard events. Continuing from the fourth article about sudoku. …
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 Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
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.

778 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