Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / VS Tools for Office / January 2007

Tip: Looking for answers? Try searching our database.

Exception thrown when re-activating an embedded OLE object (Word 2

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Andrew Wiles - 25 Jan 2007 09:56 GMT
I have added a chart to a document (Excel.Chart.8) using the
Range.InlineShapes.AddOLEObject() interface. The chart happens to be inside a
content control. After saving and re-loading the document I then wish to
programatically modify the chart. If I attempt to access it using the
following code;

                       Word.InlineShape ils =
contentControl.Range.InlineShapes[1];
                       Word.OLEFormat of = ils.OLEFormat;

a "CO_E_OBJECTNOTCONNECTED" exception is thrown.

I have tried activating the control using ils.Application.Activate() or
ils.Activate() neither of which helps.

What am I doing wrong??
Andrew Wiles - 27 Jan 2007 12:00 GMT
As often happens I have answered my own question...

Ralther than activating the InlineShape I needed to activate the OLEFormat
attribute.

                       of.Activate();

> I have added a chart to a document (Excel.Chart.8) using the
> Range.InlineShapes.AddOLEObject() interface. The chart happens to be inside a
[quoted text clipped - 12 lines]
>
> What am I doing wrong??

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.