Avatar billede Slettet bruger
16. maj 2006 - 11:18 Der er 2 kommentarer og
1 løsning

Opret en menu med en knap i Outlook med vb

Opret en menu med en knap i Outlook med vb som kan kalde en funktion.

OleIb
Avatar billede falster Ekspert
16. maj 2006 - 14:48 #1
I vba-hjælpen kan du søge under "Adding and Managing Menu Bars and Menu Items" og "Using Command Bars". Citat:

The following example creates a new command bar containing a single command bar button. By using the OnAction property of the CommandBarButton object, you can use the CopyFace method to copy the button face of the built-in Open button to the Clipboard, and then you can use the PasteFace method to paste the face onto the existing button. This changes the appearance of the command bar button at run time.

Sub testAddModifyToolbars1()
Set myBar = CommandBars _
    .Add(Name:="ChangingButton", Position:=msoBarTop, _
    Temporary:=True)
myBar.Visible = True
Set oldControl = myBar.Controls _
    .Add(Type:=msoControlButton, _
    ID:=CommandBars("Standard").Controls("Copy").Id)
oldControl.OnAction = "changeFaces"
End Sub

Sub changeFaces()
Set newControl = CommandBars.FindControl _
    (Type:=msoControlButton, _
    ID:=CommandBars("Standard").Controls("Paste").Id)
newControl.CopyFace
Set oldControl = _
CommandBars("ChangingButton").Controls(1)
oldControl.PasteFace
End Sub
Avatar billede Slettet bruger
19. maj 2006 - 11:14 #2
Set myBar = CommandBars.Add(Name:="ChangingButton", Position:=msoBarTop, Temporary:=True)

Vb melder fejl i denne linje ????

CommandBars = empty

OleIb
Avatar billede Slettet bruger
30. maj 2006 - 10:31 #3
lukker
Avatar billede Ny bruger Nybegynder

Din løsning...

Tilladte BB-code-tags: [b]fed[/b] [i]kursiv[/i] [u]understreget[/u] Web- og emailadresser omdannes automatisk til links. Der sættes "nofollow" på alle links.

Loading billede Opret Preview
Kategori
Kurser inden for grundlæggende programmering

Log ind eller opret profil

Hov!

For at kunne deltage på Computerworld Eksperten skal du være logget ind.

Det er heldigvis nemt at oprette en bruger: Det tager to minutter og du kan vælge at bruge enten e-mail, Facebook eller Google som login.

Du kan også logge ind via nedenstående tjenester