Fetstil Fetstil Kursiv Understrykning linje färgläggning tabellverk Punktlista Nummerlista Vänster Centrerat högerställt Utfyllt Länk Bild htmlmode
  • Forum & Blog
    • Forum - översikt
      • .Net
        • asp.net generellt
        • c#
        • vb.net
        • f#
        • silverlight
        • microsoft surface
        • visual studio .net
      • databaser
        • sql-server
        • databaser
        • access
        • mysql
      • mjukvara klient
        • datorer och komponenter
        • nätverk, lan/wan
        • operativsystem
        • programvaror
        • säkerhet, inställningar
        • windows server
        • allmänt
        • crystal reports
        • exchange/outlook
        • microsoft office
      • mjukvara server
        • active directory
        • biztalk
        • exchange
        • linux
        • sharepoint
        • webbservers
        • sql server
      • appar (win/mobil)
      • programspråk
        • c++
        • delphi
        • java
        • quick basic
        • visual basic
      • scripting
        • asp 3.0
        • flash actionscript
        • html css
        • javascript
        • php
        • regular expresssion
        • xml
      • spel och grafik
        • DirectX
        • Spel och grafik
      • ledning
        • Arkitektur
        • Systemutveckling
        • krav och test
        • projektledning
        • ledningsfrågor
      • vb-sektioner
        • activeX
        • windows api
        • elektronik
        • internet
        • komponenter
        • nätverk
        • operativsystem
      • övriga forum
        • arbete karriär
        • erbjuda uppdrag och tjänster
        • juridiska frågor
        • köp och sälj
        • matematik och fysik
        • intern information
        • skrivklåda
        • webb-operatörer
    • Posta inlägg i forumet
    • Chatta med andra
  • Konto
    • Medlemssida
    • Byta lösenord
    • Bli bonsumedlem
    • iMail
  • Material
    • Tips & tricks
    • Artiklar
    • Programarkiv
  • JOBB
  • Student
    • Studentlicenser
  • KONTAKT
    • Om pellesoft
    • Grundare
    • Kontakta oss
    • Annonsering
    • Partners
    • Felanmälan
  • Logga in

Hem / Forum översikt / inlägg

Posta nytt inlägg


com add-in för outlook

Postades av 2005-04-13 12:14:22 - Pelle Johansson, i forum vb.net, Tråden har 0 Kommentarer och lästs av 645 personer

Hej, jag håller på att försöka få till en knapp/länk genom att använda VB.Net's com add-in. Problemet jag har är att försöka få dit denna endast på appointment-fönstret i outlook 2003.

Är det någon som har erfarenheter av detta som kanske har löst de problem som dyker upp:

<code>
Imports Microsoft.Office.Core
Imports Extensibility
Imports System.Runtime.InteropServices

' för debugging + ref i projektet
Imports System.Windows.Forms

#Region " Read me for Add-in installation and setup information. "
' When run, the Add-in wizard prepared the registry for the Add-in.
' At a later time, if the Add-in becomes unavailable for reasons such as:
' 1) You moved this project to a computer other than which is was originally created on.
' 2) You chose 'Yes' when presented with a message asking if you wish to remove the Add-in.
' 3) Registry corruption.
' you will need to re-register the Add-in by building the RoomMateAddInSetup project
' by right clicking the project in the Solution Explorer, then choosing install.
#End Region

<GuidAttribute("FADC37EA-776E-4083-B659-0B4FBAF89957"), ProgIdAttribute("RoomMateAddIn.Connect")> _
Public Class Connect

Implements Extensibility.IDTExtensibility2

Dim applicationObject As Object
Dim addInInstance As Object

Dim WithEvents RoomMateButton As CommandBarButton

Public Sub OnBeginShutdown(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnBeginShutdown

' raderar knappen och frigör den från Outlook
RoomMateButton.Delete()
RoomMateButton = Nothing

End Sub

Public Sub OnAddInsUpdate(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnAddInsUpdate
End Sub

Public Sub OnStartupComplete(ByRef custom As System.Array) Implements Extensibility.IDTExtensibility2.OnStartupComplete

'
' adderar eller uppdaterar befintlig knapp
'

Dim oCommandBars As CommandBars
Dim oStandardBar As CommandBar

On Error Resume Next

' Set up a custom button on the "Standard" command bar.
oCommandBars = applicationObject.CommandBars
If oCommandBars Is Nothing Then
' Outlook has the CommandBars collection on the Explorer object.
oCommandBars = applicationObject.ActiveExplorer.CommandBars
End If

'oStandardBar = oCommandBars.Item("Standard")
oStandardBar = oCommandBars.Item("RoomMate")
If oStandardBar Is Nothing Then
' Access names its main toolbar Database.
oStandardBar = oCommandBars.Item("Standard")
End If

' radera tidigare ev förekomster av objektet i toolbaren
Dim ptr As Integer
For ptr = 0 To oStandardBar.Controls.Count
If oStandardBar.Controls.Item(ptr).Tag = "RoomMateButton" Then
oStandardBar.Controls.Item(ptr).Delete()
End If
Next

' In case the button was not deleted, use the exiting one.
RoomMateButton = oStandardBar.Controls.Item("RoomMateButton")
'RoomMateButton = oStandardBar.FindControl(oStandardBar.Controls, Nothing, "RoomMateButton")

If RoomMateButton Is Nothing Then

' kontrollerar även om den inte finns igen
RoomMateButton = oStandardBar.Controls.Add(MsoBarType.msoBarTypeMenuBar, 1, , 1, False)

With RoomMateButton
.Caption = "RoomMate"
.Style = MsoButtonStyle.msoButtonCaption

' The following items are optional, but recommended.
' The Tag property lets you quickly find the control
' and helps MSO keep track of it when more than
' one application window is visible. The property is required
' by some Office applications and should be provided.

.Tag = "RoomMateButton"

.ShortcutText = "Starting RoomMate"

' The OnAction property is optional but recommended.
' It should be set to the ProgID of the add-in, so that if
' the add-in is not loaded when a user clicks the button,
' MSO loads the add-in automatically and then raises
' the Click event for the add-in to handle.

.OnAction = "!<MyCOMAddin.Connect>"

.Visible = True
End With
Else
' finns redan
End If

' Display a simple message to show which application you started in.
' MsgBox("Started in " & applicationObject.Name & ".")

oStandardBar = Nothing
oCommandBars = Nothing

End Sub

Public Sub OnDisconnection(ByVal RemoveMode As Extensibility.ext_DisconnectMode, ByRef custom
As System.Array) Implements Extensibility.IDTExtensibility2.OnDisconnection
End Sub

Public Sub OnConnection(ByVal application As Object, ByVal connectMode As
Extensibility.ext_ConnectMode, ByVal addInInst As Object, ByRef custom As System.Array) Implements
Extensibility.IDTExtensibility2.OnConnection
applicationObject = application
addInInstance = addInInst

' If you aren't in startup, manually call OnStartupComplete.
If (connectMode <> Extensibility.ext_ConnectMode.ext_cm_Startup) Then _
Call OnStartupComplete(custom)

End Sub

Private Sub RoomMateButton_Click(ByVal Ctrl As Microsoft.Office.Core.CommandBarButton, ByRef
CancelDefault As Boolean) Handles RoomMateButton.Click

'MsgBox("RoomMate will start here!")
Shell("C:\program files\RoomMate\RoomMate.exe", AppWinStyle.NormalFocus, False)

End Sub

End Class

</code>


Svara

Nyligen

  • 21:41 Automotive Services UK
  • 20:44 Erfarenhet av CBD-olja mot sömnpro
  • 12:13 Sex Dolls for Sale
  • 19:42 Online Casinos for Haitian Players
  • 19:38 Rekommendera något intressant
  • 19:13 Международная перевозка грузов
  • 00:01 DL Van Tuning | Exclusive Body Kit
  • 12:08 Indian casino

Sidor

  • Hem
  • Bli bonusmedlem
  • Läs artiklar
  • Chatta med andra
  • Sök och erbjud jobb
  • Kontakta oss
  • Studentlicenser
  • Skriv en artikel

Statistik

Antal besökare:
Antal medlemmar:
Antal inlägg:
Online:
På chatten:
4 570 887
27 965
271 776
775
0

Kontakta oss

Frågor runt konsultation, rådgivning, uppdrag, rekrytering, annonsering och övriga ärenden. Ring: 0730-88 22 24 | pelle@pellesoft.se

© 1986-2013 PelleSoft AB. Last Build 4.1.7169.18070 (2019-08-18 10:02:21) 4.0.30319.42000
  • Om
  • Kontakta
  • Regler
  • Cookies