473,785 Members | 2,165 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

VB.Net COM Add-in for MS Wors 2003 Beta problem

Hi All,

I am currently working on a project, which involves
creating a COM Add-in using VB.Net, for MS Word 2003.

As usual, I am creating few custom menu buttons under the
File and Tool menus. These menu buttons are being created
in the OnStartupComple te event and removed in the
OnBeginShutdown event of the COM Add-in's connect class.
So, as per logic, everytime the Word starts, custom menu
buttons should get created, and on closure they should get
deleted.

Now my problem is that when I install the add-in and run
MS Word, i can see the custom created buttons. But when i
close the MS Word, the custom created buttons are not
getting deleted. I have checked this.... i.e. i un-
installed the COM-Add-in and run MS Word...the earlier
created custom menu buttons are still there! ...... and as
per logic, since Word is deleting them everytime COM Add-
in is closed, they should have not been there .....

I tested whether the menu buttons are being deleted in the
OnBeginShutdown ....and they were...but some how...they
were being deleted temporarily.... .and not permanentlly.

I wud like to mention here .. that I am using
CommandBarContr ol and CommandBar objects to create the
custom menu items. Also, I am using temporary=true
parameter while adding the commandbarcontr ol.

Hence, i wud like to request u to kindly help or guide me
on this issue.

......its very urgent and I have already wasted lot of time
on it!

Thanxs in advance for ur kind help!!!

Jassi
Nov 20 '05 #1
3 3954
Hi Jitender,

You don't mention whether you're setting a
CustomizationCo ntext before creating/deleting the
CommandBarButto ns. Note that the temporary argument does NOT
work for CommandBarButto nControls.

Word can save changes to commandbars in four different
"places", and if you don't specify, what it chooses as the
default when you create may not be the same default Word
decides to use to delete. So things won't get deleted. I see
this question, oh, maybe once a week when cruising the
Developer groups.
As usual, I am creating few custom menu buttons under the
File and Tool menus. These menu buttons are being created
in the OnStartupComple te event and removed in the
OnBeginShutdown event of the COM Add-in's connect class.
So, as per logic, everytime the Word starts, custom menu
buttons should get created, and on closure they should get
deleted.

Now my problem is that when I install the add-in and run
MS Word, i can see the custom created buttons. But when i
close the MS Word, the custom created buttons are not
getting deleted. I have checked this.... i.e. i un-
installed the COM-Add-in and run MS Word...the earlier
created custom menu buttons are still there! ...... and as
per logic, since Word is deleting them everytime COM Add-
in is closed, they should have not been there .....


Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)

Nov 20 '05 #2
Hi Jitender,
But there is one small problem, at the time of menu addition in
OnStartupComple te... it is saving the custimization in Normal.Dot
file...but while menu deletion in OnBeginShutdown , things are not
getting saved implicitly..i.e . i have to give NormalTemplate. Save()
explicitly inorder to save the menu deletion in Normal.Dot.

Is it the way it works?

Put very simply, yes: this is the way it works.

More background: when you make changes to the NormalTemplate
(Normal.dot), Word won't ask or warn anyone about saving these until
the users quits Word. Then, depending on whether the option to prompt
to save changes to Normal.dot is activated (Tools/Options/Save), the
user may get a prompt to this effect. (Default if the option is not
activated is to save any changes.)

You run into a potential conflict with the user, here, if you try to
answer this question yourself at the END of the session, because the
user may well have added AutoText entries, macros, keyboardshortcu ts
or their own menu customizations. Or may have been "playing" with
this kind of thing and be counting on NOT saving the changes. You
have no way of knowing. Unless, of course, you are fully controlling
this instance of Word (but then you could run into conflicts if the
user has a second instance running, because they will share
Normal.dot.)

Note that if you're certain no changes whatsoever should be saved to
the NormalTemplate, you can set NormalTemplate. Saved = True so that
Word ignores any changes; the prompt would not appear. (This does NOT
save changes, just changes what we used to call the "Dirty" flag.)

Due to this Word "idiosyncra cy" with Normal.dot, it might be better
to supply your own Addin template, or create the document in which
the user will be working with your application from your own, special
template. This would also have the advantage that you wouldn't have
to repeatedly create and destroy toolbars, as they could be saved
directly in the template file...

Cindy Meister
INTER-Solutions, Switzerland
http://homepage.swissonline.ch/cindymeister
http://www.mvps.org/word
http://go.compuserve.com/MSOfficeForum

This reply is posted in the Newsgroup; please post any follow
question or reply in the newsgroup and not by e-mail :-)

Nov 20 '05 #3
Hi Cindy,

Thanxs for ur reply.... I got ur point and i appreciate ur positive
response.

Though I might be bugging u and I am sorry for the same... but I have
one more query related to the topic...

I understand.. that in order to run a COM add-in in MS Word, which is
developed in VB.Net.... we need to have a certified custom shim
developed in VC++.Net... otherwise when the security is set at high our
add-in will not be loaded by the word coz u cant certify mscoree.dll
(though u can certify mscoree.dll, but there are other associated risks
involved with that)..

Now, I have gone though MS documentations, that u can develop a COM
Add-in shim in VC++.Net as well as in VB 6.0 ...I have
downloaded/accessed lot of material as well as source code for VC++.net
shim, but none for VB 6.0

Hence, do u have any idea as, what should I do to develop a COM Add-in
Shim in VB 6.0? If u have some sample code or site URL...kind advise me
of the same.

T&R!!!

Jassi

*** Sent via Developersdex http://www.developersdex.com ***
Don't just participate in USENET...get rewarded for it!
Nov 20 '05 #4

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

Similar topics

5
2327
by: Mike L | last post by:
I have two questions. 1) What is the code to check if datagrid already has a datasource? When the user clicks "ADD" button I want to add a record to the data grid, if the user clicks "ADD" again I want another record added to the datagrid. 2) What is the code to get the selected row of the combo box, I need colume one and three?
4
1384
by: Maarten | last post by:
i have the folowing code to setup my datagrid collumns Private Sub Form1_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load gridsetup() end sub
8
3931
by: Yuk Tang | last post by:
I am tearing my hair out over this, since I can't see what I'm doing wrong (duh, if I knew, I wouldn't be asking the question). I am adding Field items to a Field Collection, but for some reason it wants to start from the beginning and overwrite all entries before adding the latest member. I've added a couple of msgboxes to illustrate this, one at the add method, another cycling through the collection after the addition has been made. ...
0
2035
by: herman404 | last post by:
Hi everyone, I'm trying to dynamically add 3 button columns to a DataGrid object that I have on an ASP.net webpage, but I don't see any documentation on how to do it. I've seen plenty of examples on how to add regular columns, but how do you declare a button column? My code is posted below, I have a placeholder on a webform, and the datagrid will be added on the placeholder once it is initalised. Thanks! System.Web.UI.WebControls.Label...
3
8018
by: Greg Scharlemann | last post by:
I'm not sure the best way to accomplish this... my hunch is with javascript, but I'm not sure if using server side code (PHP) would be easier. I'm adding people to a database. People have a first name, last name, and a undetermined number of Cities and States with which they can be associated. I've got a drop down box that I would like to use to display the number of inputs to allow for city/state entry. I would like to dynamically...
2
3791
oll3i
by: oll3i | last post by:
public class Kwiaty { private List<Kwiat> lista_kwiatow = new ArrayList<Kwiat>(); RozaCzerwona roza_czerwona = new RozaCzerwona(); RozaBiala roza_biala = new RozaBiala(); RozaZolta roza_zolta = new RozaZolta(); lista_kwiatow.add(roza_czerwona); lista_kwiatow.add(roza_biala); lista_kwiatow.add(roza_zolta); }
1
2579
by: Sri Nanduri | last post by:
Hi , I am new to JS. Please help me to resolve my issue. 1.When the form loads there are two DropDown boxes and a ADD button. 2.When I click the add button it will add two DropDown boxes and a add button. I am calling a function onclick of first add button. I was able to produce two DropDown boxes, but not the button. Step 2 will be done whenever the user press Add button. Here is my code. Please suggest if there is a better way to code...
0
1657
by: anureddy | last post by:
help me how to add datagridview columns to another table,using windowsapplications. and set the displaymember and value member datagridviewcomboboxcolumn. i used this below code but that not exicute. how can i write that code. pls send me code.
3
1028
by: guilherme21922 | last post by:
I created a new dropdownlist with the event selectedIndexChanged, but he never dispared!! what i am doing wrong? Thanks for (int i = 0; i < 2; i++) { DropDownList dl = new DropDownList(); dl.ID = dl + i.ToString(); dl.DataTextField = "name";
2
1428
by: Question123 | last post by:
<root> <Element> <add key="1" value="1"/> <add key="2" value="2"/> <add key="3" value="3"/> <add key="4" value="4"/> </Element> <Items>
0
9489
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10356
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10162
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10100
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
6744
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5396
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5528
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2893
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.