Google Answers Logo
View Question
 
Q: Add a custom button to Outlook Express' toolbar ( No Answer,   6 Comments )
Question  
Subject: Add a custom button to Outlook Express' toolbar
Category: Computers > Programming
Asked by: gregthomson-ga
List Price: $100.00
Posted: 30 May 2002 08:26 PDT
Expires: 07 Jun 2002 10:22 PDT
Question ID: 18898
I am trying to add a custom button to Outlook Express 6's toolbar
through Visual Basic.  Outlook Express 6 uses the toolbarwindow32
control, and I need the know the proper API calls to add my own
button.  This has to be done with Visual Basic, but can use any other
free DLL's.  The soure code provided must work, and not just be links
to pages which show how to do it.

This is possible -- www.confimax.com has done it.

Clarification of Question by gregthomson-ga on 30 May 2002 14:00 PDT
To avoid some confusion: 
 
When I mentioned that I wanted to a a custom button to the toolbar,
this button is one of my own creation, and not an existing button in
Outlook Express.  An example would be a button that you can click that
would open notepad.exe 

Request for Question Clarification by xemion-ga on 30 May 2002 14:19 PDT
The answer to this calls for advanced visual basic programming skills
and experience in integrating Visual C++ libraries with VB.  It's
honestly above my skill level and I don't know if I'll be able to help
you, but I wanted to see what your skill level was first.  Do you
think you're experienced enough at vb to try something like this? 
Thanks.
 
xemion-ga 

Clarification of Question by gregthomson-ga on 30 May 2002 15:10 PDT
Yes, I am at a programming level where I can incorporate both VC++
DLL's, and VB.  I am currently doing so, but it's just not working
properly, so I figured I would try this route.  I already have all of
the Win32 API definitions, Constants, and type defs, but when I try to
call TB_ADDBUTTON, or TB_INSTERTBUTTON, I can't seem to get anything
but 1 of 4 things:
 
1) Nothing Happens 
2) I get an illegal operation when I call TB_ADDSTRING 
3) I get an illegal operation when I call TB_ADDBUTTON 
4) I get a button with no text, disabled, and the image of another
button
 
Thank you. 

Request for Question Clarification by xemion-ga on 30 May 2002 15:41 PDT
Well, you're more advanced than I am.  I don't know why you're getting
those errors.  I think the way you're going about it is the only way
to do it.  That looks like what Confimax did.  Thanks and sorry I
wasn't able to be a help.
 
xemion-ga 

Request for Question Clarification by blader-ga on 30 May 2002 20:12 PDT
Dear greg: 
 
Are you sure Outlook Express 6 uses the ToolbarWindow32 control? I
heard that Outlook uses MSOCommandBar.
 
Best Regards, 
blader-ga 

Clarification of Question by gregthomson-ga on 31 May 2002 06:24 PDT
Hello, 
 
Outlook (And all other MS Office applications) use MSOCommandBar. 
Outlook Express 5 and 6 both use ToolbarWindow32.  Using MS Spy++, you
can find this information out by simply locating the Outlook Express
toolbar.
 
Thank you. 
Answer  
There is no answer at this time.

The following answer was rejected by the asker (they received a refund for the question).
Subject: Re: Add a custom button to Outlook Express' toolbar
Answered By: remoran-ga on 03 Jun 2002 13:17 PDT
Rated:1 out of 5 stars
 
There is one way to do it using Microsoft AQL Servr Digital Dashboard
3.0 as this provides extensive fron end customization to Outloook
without too
much of a problem. I used this for a client a couple of years ago and
it worked out pretty well for me. (I am not a prgrammer but I learned
how to customize Outlook after doing some pretty serious digging into
exatcly how DD work with the app.   The download link is
http://www.microsoft.com/downloads/release.asp?ReleaseID=29414. Note
you need 2000 professional with IIS and SQL Server, both of which are
freebies if you already have 2000 Professional. A more specific link
is the one dealing with Web Parts and Dashboard. This is
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/modcore/html/deconAddingWebPartsByUsingOfficeDeveloperDigitalDashboardProjects.asp
 
HTH 

As an aside, it looks like Dashboard is becoming a component of Portal
Server as seen in this link. http://www.microsoft.com/sharepoint/

Request for Answer Clarification by gregthomson-ga on 03 Jun 2002 13:41 PDT
This definitely didn't answer my questions -- Clarification: 
 
1) This has to work with Outlook Express 5 or 6.  Not Outlook 2000 or
XP.  Outlook 2000/XP could be done using a simple COM component.
 
2) This has to work on all OS's from 95 to XP.  This solution doesn't
work with anything below 2000.
 
This has to be done programatically, and in the original question I
specifically said that I require working source code, and not just
links.  

Clarification of Answer by remoran-ga on 03 Jun 2002 16:14 PDT
Second try. In the Microsoft Systems Journal,
&lt;a href=&quot;<a href="http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0198/coolmenu.htm&amp;amp;nav=/msj/0198/newnav.htm">http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0198/coolmenu.htm&amp;amp;nav=/msj/0198/newnav.htm</a>&quot;&gt;<a href="http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0198/coolmenu.htm&amp;amp;nav=/msj/0198/newnav.htm">http://www.microsoft.com/msj/defaultframe.asp?page=/msj/0198/coolmenu.htm&amp;amp;nav=/msj/0198/newnav.htm</a>&lt;/a&gt;
is a very imformative article complete with graphics, describing how
to code cool menu buttons for Outlook. Even thought the article was
written for Outlook 97, the author has updated PixieLib, the app he
designed, to generate the code &amp;amp; graphic objects in his report. His
website is &lt;a href=&quot;<a href="http://www.dilascia.com/">http://www.dilascia.com/</a>&quot;&gt;<a href="http://www.dilascia.com/">http://www.dilascia.com/</a>&lt;/a&gt; and the updated app(s) is on
&lt;a href=&quot;<a href="http://www.dilascia.com/PixieLib.htm">http://www.dilascia.com/PixieLib.htm</a>&quot;&gt;<a href="http://www.dilascia.com/PixieLib.htm">http://www.dilascia.com/PixieLib.htm</a>&lt;/a&gt;
 
This could be what you are looking for both for code and custom button
genration in Outlook.  (Note, you will need Visual Studio 6.0 running
on 95 or NT 4.0.)
 
Sorry about Dashboard but it did work for the job I did for a former
client.
 
Bob  

Request for Answer Clarification by gregthomson-ga on 04 Jun 2002 06:38 PDT
Hello... 
 
Your dashboard answer was way off, and the same answer that you used
to incorrectly answer a post from another user asking how to set the
password in Outlook Express from Visual Basic.  As for me, you still
havn't answered me original question.
 
1) &amp;quot;I am trying to add a custom button to Outlook Express 6's
toolbar...&amp;quot;
 
You gave me a link which describes how to add a button to a normal MFC
application which doesn't use the toolbarWindow32 class
 
2) &amp;quot;through Visual Basic.&amp;quot; 
 
You gave me a link which uses C++ code.  I understand C++ code, but
requested VB.
 
3)  &amp;quot;Outlook Express 6 uses the toolbarwindow32 control, and I need
the know the proper API calls to add my own button.&amp;quot;
 
Again, that article has nothing to do with Outlook Express, and didn't
deal even with the ToolbarWindow32 Class.  I don't know how you though
this article was relevant.
 
 
4) &amp;quot;This has to be done with Visual Basic, but can use any other free
DLL's.&amp;quot;
 
Again, the same as #2.  Only link you provided which does me no good
is also in C++.
 
5) &amp;quot;The soure code provided must work, and not just be links to pages
which show how to do it.&amp;quot;
 
You didn't provide me with any sourcecode, but only 1 link to a site
which gave me absolutely no good information.
 
I didn't post this question on here because I had no idea how to do
this -- I posted it because I was having difficulties, and expected to
get a correct answer.  I specifically said that I wanted source code
because I couldn't get it working myself.  I could personally provide
over 50 links to pages which explain how to add a button to a
ToolbarWindow32 class in C++, and VB, but none of those deal with
Outlook Express, or another appplication for that matter.  Please read
the question before your answer another persons question.  And I
really didn't like the fact that you gave me an answer that you
already posted to somebody else, and expected me to pay $100 for it.
 
Either post the correct answer, and read my question, or decline the
question.  

Clarification of Answer by remoran-ga on 04 Jun 2002 09:18 PDT
The third and last time on this. Go to
&lt;a href=&quot;<a href="http://www.mvps.org/vbnet/index.html?code/comctl/tbarie5prob.htm">http://www.mvps.org/vbnet/index.html?code/comctl/tbarie5prob.htm</a>&quot;&gt;<a href="http://www.mvps.org/vbnet/index.html?code/comctl/tbarie5prob.htm">http://www.mvps.org/vbnet/index.html?code/comctl/tbarie5prob.htm</a>&lt;/a&gt; .
Looks like these folks really know Visual Basic particularly regarding
&amp;quot;Fixing the IE5/MsComCtrl 5 Toolbar Problem&amp;quot;
 
BTW, they provide source. 
 
Bob  

Request for Answer Clarification by gregthomson-ga on 05 Jun 2002 08:51 PDT
Again, 
 
This link is not useful to me.  I know all of this information, I
wanted source code from YOU as my answer.  I am having problems, and
wanted a working sample.  I obviously came to the wrong place.  

Clarification of Answer by remoran-ga on 05 Jun 2002 11:02 PDT
I have no problem declining the anwser but I have to ask, did you test 
the code given by max_answer-ga? If that works, he should get the 
money you are offering to solve your problem. (looks like he knows a 
lot about VB and Outlook.) Regarding the same answer given to two 
parties, for that I am truly sorry as I inadvertently did a copy/paste 
of my response after spending quite a bit of time seeing if the 
Digital Dashboard approach would solve these two rather similar 
questions. (One can get lost trying to help somebody out) 
  
Also, I clearly stated I am not a programmer and the original question did not 
ask for specific source code from anyone answering the question. 
  
Bob 
Reason this answer was rejected by gregthomson-ga:
The answer given was not at all what I asked for.  If you look at the
question, you will see what I mean.
gregthomson-ga rated this answer:1 out of 5 stars
The first answer given was the same answer he gave somebody else, and
was wrong for both my answer, and the other person.  Definitely didn't
answer my question at all.

Comments  
Subject: Re: Add a custom button to Outlook Express' toolbar
From: foodie212-ga on 30 May 2002 13:53 PDT
 
Here's something you might want to try -- 
http://www.lowendmac.com/ibasics/010321.html
Subject: Re: Add a custom button to Outlook Express' toolbar
From: foodie212-ga on 30 May 2002 13:55 PDT
 
And another --
http://www.wurd.com/eng/ABCs/oe5_customize.htm

Best wishes!
Subject: Re: Add a custom button to Outlook Express' toolbar
From: max_answer-ga on 30 May 2002 14:25 PDT
 
I believe the following is what you are looking for:

Visual Basic 6.0 / Create a New Toolbar Button and Capture Its Click Event
 
Private Sub Initialize_handler()
	'Create references to the Outlook Explorer 
	'and the Contacts folder items
	Set oExplorer = oOutlook.ActiveExplorer
	Set oItems = oOutlook.GetNamespace _
		("MAPI").GetDefaultFolder _
		(olFolderContacts).Items
    
	'Create toolbar button
	Set oButton = oOutlook.ActiveExplorer _
		.CommandBars("Standard").Controls.Add _
		(Temporary:=True, Before:=5)
	With oButton
		.Caption = "DB Update"

		.DescriptionText = "DB Update"
		.ToolTipText = "Save Selected " & _
			"Contact(s) to Database"
		.BuiltInFace = True
		.Style = msoButtonIconAndCaption
		.FaceId = 643
		.Visible = True
	End With
End Sub
  
'Then simply call the newly created initialize 
'routine in the OnStartupComplete event 
'procedure, which will create our button and set 
'our oItems variable when Outlook starts

Private Sub IDTExtensibility2_OnStartupComplete()
	Initialize_handler
End Sub

'The OnStartupComplete event procedure will be 
'called when Outlook is done loading. The toolbar 
'button will be added to Outlook, but the click 
'event will not be trapped because there's no 
'event procedure defined yet. To add code to trap 
'the button click, add the following event 
'procedures to the class module

Private Sub oButton_Click _
	(ByVal Ctrl As Office.CommandBarButton, _
	CancelDefault As Boolean)
	Dim sPrompt As String
	Dim nCount As Integer
    
	nCount = oOutlook.ActiveExplorer _
		.Selection.Count
	If nCount = 0 Then Exit Sub
    
	sPrompt = "Would you like to update these _
		" & nCount & " item(s) to the database?"
	If MsgBox(sPrompt, vbYesNo + vbQuestion) _
		= vbYes Then
		Call InsertContacts _
			(oOutlook.ActiveExplorer.Selection)
	End If
End Sub

'Now do the same type of thing to trap the 
'Contacts folder item add event

'ItemAdd will be called when a new item is 
'added to the Contacts folder
	Private Sub oItems_ItemAdd _
		(ByVal Item As Object)
	Dim sPrompt As String
    
	sPrompt = "I see you've added " & Item & _
		".  Would you like this contact added " & _
		"to the database?"
	If MsgBox(sPrompt, vbYesNo + vbQuestion) _
		= vbYes Then
		Call InsertDBContact(Item)
	End If
End Sub
Subject: Re: Add a custom button to Outlook Express' toolbar
From: max_answer-ga on 30 May 2002 14:26 PDT
 
By the way, the code from my last past can be found at the following URL:
http://www.devx.com/premier/mgznarch/exchange/2001/08aug01/oa0108/oa0108.asp

By clicking the green text: (see Listing 1) within the article.

Regards,
Max
Subject: Re: Add a custom button to Outlook Express' toolbar
From: xemion-ga on 30 May 2002 14:39 PDT
 
I'm not a 100% sure, but I don't think that Max's answer will work for
Outlook Express.  Just fyi.

xemion-ga
Subject: Re: Add a custom button to Outlook Express' toolbar
From: remoran-ga on 05 Jun 2002 10:59 PDT
 
I have no problem declining the anwser but I have to ask, did you test
the code given by max_answer-ga? If that works, he should get the
money you are offering to solve your question. (looks like he knows a
lot about VB and Outlook.) Regarding the same answer given to two
parties, for that I am truly sorry as I inadvertently did a copy/paste
of my response after spending quite a bit of time seeing if the
Digital Dashboard approach would solve these two rather similar
questions. (One can get lost trying to help somebody out)

Also, I stated I am not a programmer and the original question did not
ask for specific source code from anyone answering the question.

Bob

Important Disclaimer: Answers and comments provided on Google Answers are general information, and are not intended to substitute for informed professional medical, psychiatric, psychological, tax, legal, investment, accounting, or other professional advice. Google does not endorse, and expressly disclaims liability for any product, manufacturer, distributor, service or service provider mentioned or any opinion expressed in answers or comments. Please read carefully the Google Answers Terms of Service.

If you feel that you have found inappropriate content, please let us know by emailing us at answers-support@google.com with the question ID listed above. Thank you.
Search Google Answers for
Google Answers  


Google Home - Answers FAQ - Terms of Service - Privacy Policy