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 / Languages / Managed C++ / June 2004

Tip: Looking for answers? Try searching our database.

VC++ .NET 2003 and Office 2000

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Mike Duncan - 10 Jun 2004 20:10 GMT
Helo All - I am working on a good ol Microsoft Word Control for windows forms. I have the control displayed and it sizes and moves but when I start to try and mess with the command bars It freaks out.

One I can't even access command bars unless I:
namespace Office = Interop::Office;

But the the whole IDE crashes when I:
Office::

I mean the whole thing goes down after adding the second colon.

and If I don't add the:
namespace Office = Interop::Office;

I can't compile becuase it says Office::CommandBars is inaccessable or undefined.

If any more info is needed I can do that but I am  seriously getting frustrated with this .net interop stuff.

Any help would be sooo apreciated. Thanks.
Mike Duncan - 11 Jun 2004 18:39 GMT
Testing Testin 1.2.3

I can't Post???
Mike Duncan - 11 Jun 2004 18:40 GMT
Here is a little code snippet:

Office::CommandBars * pWCmdBars;                 // The CommandBars
Word::Document * pWDoc;                               // The Word document
static Word::ApplicationClass * pWApp;              // The Word Application

pWApp = new Word::ApplicationClass;               // <- This starts WinWord.exe
pWCmdBars = pWApp->get_CommandBars();     // <- This works
Int32 n = pWCmdBars->get_Count();                  // <- This throws an exception

I am absolutly baffled by this exception because when tracing throw the code I can watch pWCmdBars and see that Count = 108.

Go figure but I guess I am one step closer.

Note: I have tried modifying the Command bars both before and after setting the window visible.

Here is a snippet of the Watch:

- pWCmdBars  0x04a8be68  Office.CommandBars

- [Office.CommandBarsClass]  0x04a8be68  Office.CommandBarsClass

 System.Object         0x04a8be68   System.Object
 ActionControl   <undefined value> Office.CommandBarControl
+ ActiveMenuBar       0x00988ed8    Office.CommandBar
 AdaptiveMenus           false       bool
+ Application            0x00988ed8  System.Object
 Count                        108         __int32
 Creator                    97307460  __int32
 DisplayFonts               true        bool
 DisplayKeysInTooltips  false       bool
 DisplayTooltips           true        bool
...
 LargeButtons             false        bool
...
 Parent  <error: an exception of type: 0x00988ed8 occurred>  System.Object
 TmcGetName  <cannot view indexed property>  __int32
...
Mike Duncan - 11 Jun 2004 21:50 GMT
OK So I can use:
pWApp->get_ActiveWindow()->get_Panes()->Item(0)->set_FullScreen(true);

to hide the bars (kind of), but I still can't do the supposedly simple:

pWApp->get_CommandBars->Item(x)->set_Enabled(false);

Does any one have some insight here????

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.