Outlook 2003 check group exist in shortcuts and add SHortcut

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

Hello Peopl

i had a problem with outlook 2003 and add shortcut programatically, de compiler generata 429 erro on add method, i declare explicitly de objects and not obtain sucess
My questions is , why function this in outlook 2003, check if group exist and add shortcuts with URL

Please help me

TI

Marcelo
 
Please show a code snippet that demonstrates the statement that generates the error and any preceding statements that instantiate related objects.
--
Sue Mosher, Outlook MVP
Outlook and Exchange solutions at http://www.slipstick.com
Author of
Microsoft Outlook Programming: Jumpstart
for Administrators, Power Users, and Developers
 
hi sue the code snippet for add shortcuts on 2003 with problem i comment line in cod

Sub createOLLink(

Dim MyolApp As Outlook.Applicatio
Set MyolApp = CreateObject("Outlook.Application"

Set myolBar = MyolApp.ActiveExplorer.Panes.Item("OutlookBar"


Set myolGroup = myolBar.Contents.Groups.Item(1).Shortcut

' parametros caminho, Título do icone, ordem que aparecem dentro do grupo(se nao tiver nhum no gupo comeca com 0 e vai .1..2..
Dim objOB As OutlookBarPan
Dim objOBGroup As OutlookBarGrou
Dim objShortcut As OutlookBarShortcu
Dim colShortcuts As OutlookBarShortcut

Set objApp = CreateObject("Outlook.Application"
Set objOB = objApp.ActiveExplorer.Panes.Item("OutlookBar"
Set objOBGroup = objOB.Contents.Groups.Item(2


For Each Item In objOB.Contents.Group
If Item.Name = "Atalhos do Outlook" The
nome = Item.Nam
caminho = "Outlook:Contatos/Contatos Jurídicos
End I
If Item.Name = "Outlook Shortcuts" The
nome = Item.Nam
caminho = "outlook:Contacts\Contatos Jurídicos
End I
Nex



With myolGrou
'''Hi Sue the problems is here for create shortcuts on 2003, this is correct for 2000 and 2002 but no on 200
.Add "file://C:/PRAXIS/dd_praxis/biblioteca.htm", "Serviços",

.Add "file://C:/PRAXIS/dd_praxis/informacoes.htm", "Informações",

'''outlook:Contacts\Contatos Jurídico
.Add caminho, "Contatos Jurídicos",
End Wit


Set myolGroup2 = myolBar.Contents.Groups.Item(2

With myolGroup
.Shortcuts.Add "file://C:/PRAXIS/dd_praxis/biblioteca.htm", "Serviços",
'MsgBox "OK Atalho1", vbOKOnl
.Shortcuts.Add "file://C:/PRAXIS/dd_praxis/informacoes.htm", "Informações",
'MsgBox "OK atalho2", vbOKOnl
'''outlook:Contacts\Contatos Jurídico
.Shortcuts.Add caminho, "Contatos Jurídicos",
End Wit


Set MyolApp = Nothin
Set myolBar = Nothin
Set myolGroup = Nothin
Set myOlShortcuts = Nothin

Set objShortcut = Nothin
Set colShortcuts = Nothin
Set objOBGroup = Nothin
Set objOB = Nothin
Set objApp = Nothin

End Sub
 
HI Sue

i encountered on the the outlook 2003 object model poster and i use it to direction my code and solved full this problem.
Snippet with solution is here:

Private Sub teste2()
Dim OlBarPane As Outlook.OutlookBarPane
Dim OlExplorer As Outlook.Explorer
Dim OlBarPane2 As OutlookBarGroups
Set OlExplorer = Application.ActiveExplorer
Set OlBarPane = OlExplorer.Panes("OutlookBar")
Set OlBarPane2 = OlBarPane.Contents.Groups





'Faz a Pane do Outlook Visivel se estiver escondida
If OlBarPane.Visible = False Then
OlBarPane.Visible = True
End If


If OlBarPane2.Item(1).Name = "MEUGRUPO" Then

End
Else
' adiciona grupo
OlBarPane2.Add "MEUGRUPO", 1
MsgBox "The Current Outlook Bar Group is " & OlBarPane.CurrentGroup, vbInformation
''Adiciona Shortcuts
If (OlBarPane.CurrentGroup = "MEUGRUPO") Then
'As duas formas abaixo funcionam
OlBarPane2.Item("MEUGRUPO").Shortcuts.Add "file://C:/link/meulink.htm", "Serviços", 1
'OlBarPane.CurrentGroup.Shortcuts.Add "file://C:/link/meulink.htm", "Serviços", 1
End If



End If

End Sub

Thank you for your reply my message. I contribute this with code.

Att ,
 
Back
Top