473,396 Members | 1,923 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

VC++ .NET 2003 and Office 2000

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.
Nov 17 '05 #1
3 2004
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
....
Nov 17 '05 #2
Testing Testin 1.2.3

I can't Post???
Nov 17 '05 #3
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????
Nov 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Todd D. Levy | last post by:
I recently picked up a copy of Office 2003, but have installed it (replacing my existing installation of Office XP Pro) yet because... I am in the middle of a client project using Access 2002...
28
by: Neil Ginsberg | last post by:
I have a client who is using Access 2002/2000 (the database itself is written in 2000), and is considering migrating to Access 2003. Any recommendations on whether Access 2003 is worth the migrate,...
2
by: Jeff | last post by:
Does anyone know of any potential problems running a 2000 database with 2003? Also, what about installing all other Office products as 2003 versions but leaving Access as 2002 running a 2000...
2
by: Lauren Wilson | last post by:
Hi Folks, I have a widely distributed Access 200 Application. I must retain my ability to support users who are still on Access 2000 and Access 2000 Runtime. However I also need to upgrade my...
0
by: HelenD | last post by:
Last night took the plunge and upgraded to Office 2003 pro, and told it to get rid of 2000. Realized too late that some programs (such as FMS Develper Suite) do not yet include the components to...
10
by: Lauren Wilson | last post by:
Ok I have searched the MS website for info on this. I am totally confused. If I want to deploy an Access 2003 app and allow my users to run it using Access 2003 Runtime, where do I get the...
3
by: Malcolm Webb | last post by:
My database was developed and is currently running in Access 2000. I am contemplating upgrading to the latest version of Access (2003?) running on new computers. Will there be any major...
11
by: Dr. Zharkov | last post by:
We want to export myArrayVB (2000, 2) of VB .NET 2003 in myArrayVó of VC++ .NET 2003 on scheme "component - client". But there is an error. For development of a component in VB .NET 2003 we...
9
by: Neil | last post by:
We have an Access 2000 MDB with a SQL 7 back end. We are upgrading SQL Server to SQL 2005, and are considering upgrading to Access 2003. Someone mentioned that they had heard about some...
4
by: snare88 | last post by:
I have a question regarding a VB.NET 2003 application which was built on a Windows XP machine with Office 2002 installed. The software does some interfacing with Microsoft Excel. I now want to...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.