PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook Program Addins Creating a simple add-in.

Reply

Creating a simple add-in.

 
Thread Tools Rate Thread
Old 23-03-2005, 02:51 PM   #1
Dan Berachowitz via OfficeKB.com
Guest
 
Posts: n/a
Default Creating a simple add-in.


Hi

I would like to build an add-in that will create a textbox and a button in
the outlook toolbar , and when I press on the button, it will add a new
contact with my details.
How do I do that? it supposed to be very easy..

Thanks!!
Dan

--
Message posted via http://www.officekb.com
  Reply With Quote
Old 23-03-2005, 02:58 PM   #2
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Creating a simple add-in.

Go to http://www.microeye.com and get the Items Command Bar sample add-in.
It will show you everything you need to know.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Dan Berachowitz via OfficeKB.com" <forum@OfficeKB.com> wrote in message
news:d29280943cc9418f8c44a5116fb8904f@OfficeKB.com...
> Hi
>
> I would like to build an add-in that will create a textbox and a button in
> the outlook toolbar , and when I press on the button, it will add a new
> contact with my details.
> How do I do that? it supposed to be very easy..
>
> Thanks!!
> Dan
>
> --
> Message posted via http://www.officekb.com



  Reply With Quote
Old 23-03-2005, 07:37 PM   #3
Dan Berachowitz via OfficeKB.com
Guest
 
Posts: n/a
Default Re: Creating a simple add-in.

I downloaded all the files but I dont know what to do with it...

--
Message posted via http://www.officekb.com
  Reply With Quote
Old 23-03-2005, 09:14 PM   #4
Helmut Obertanner
Guest
 
Posts: n/a
Default Re: Creating a simple add-in.

Hello Dan,

maybe this is a simple solution for you, it's not an AddIn, it's just
macros.

Installation:
Start Outlook
Press Alt + F11

DoubleClick on Project | Microsoft Outlook | ThisOutlookSession
Paste in this code:
'--------------------------------------------------
Private Sub Application_Startup()

CreateCommandBar

End Sub
'----------------------------------------------------
then

Click on Module and if there is a Module1 DoubleClick, if not Create a new
one

paste in this code:
'----------------------------------------------------
'This function creates our CommandBar
'It's called from Application.StartUp event in 'ThisOutlookSession'
Public Sub CreateCommandBar()

On Error Resume Next

Dim objCommandBar As CommandBar
Dim objButton As CommandBarButton
Dim objTextBox As CommandBarControl

'Create a new CommandBar
Set objCommandBar = ActiveExplorer.CommandBars.Add("Contacter", , ,
True)
objCommandBar.Visible = True
objCommandBar.Position = msoBarTop

'Create a simple Textbox
Set objTextBox = objCommandBar.Controls.Add(Office.msoControlEdit, , , ,
True)
objTextBox.Caption = "ClickBox"
objTextBox.Tag = "ClickBox"
objTextBox.Width = 200
objTextBox.OnAction = "NewContact"


'Create a nice Button
Set objButton = objCommandBar.Controls.Add(msoControlButton, , , , True)
objButton.Caption = "New Contact"
objButton.Style = msoButtonIconAndCaption
objButton.FaceId = 607

'Tell the Button which Macro has to be called on click...
objButton.OnAction = "NewContact"

' Forget the Objects
Set objButton = Nothing
Set objTextBox = Nothing
Set objCommandBar = Nothing
End Sub

'Here we create our new Contact with Information from Textbox....
Public Sub NewContact()
On Error Resume Next

Dim objTextBox As CommandBarControl
Dim objContact As ContactItem

Application.CreateItem olContactItem
'Get the Textbox
Set objTextBox =
ActiveExplorer.CommandBars("Contacter").FindControl(Tag:="ClickBox")

Set objContact = Application.CreateItem(olContactItem)
objContact.FullName = objTextBox.Text
objContact.Display

Set objContact = Nothing
Set objTextBox = Nothing
End Sub
'----------------------------------------------------

The Textbox however needs to press enter to get the text.
I Programmed so that if you press enter the contact is created.

P.S. learned from Sue ;-)

--
regards

Helmut Obertanner
Technical Consultant

Softwaredevelopment
DATALOG Software AG | Zschokkestr. 36 | D-80687 Munich
web: www.datalog.de


.... and IT works!

"Dan Berachowitz via OfficeKB.com" <forum@OfficeKB.com> schrieb im
Newsbeitrag news:843839c2f33a41388f21b64391c6ea03@OfficeKB.com...
>I downloaded all the files but I dont know what to do with it...
>
> --
> Message posted via http://www.officekb.com



  Reply With Quote
Old 23-03-2005, 10:41 PM   #5
Sue Mosher [MVP-Outlook]
Guest
 
Posts: n/a
Default Re: Creating a simple add-in.

Load the project file into VB and study it and its components.

--
Sue Mosher, Outlook MVP
Author of
Microsoft Outlook Programming - Jumpstart for
Administrators, Power Users, and Developers
http://www.outlookcode.com/jumpstart.aspx


"Dan Berachowitz via OfficeKB.com" <forum@OfficeKB.com> wrote in message
news:843839c2f33a41388f21b64391c6ea03@OfficeKB.com...
>I downloaded all the files but I dont know what to do with it...
>
> --
> Message posted via http://www.officekb.com



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off