Put Outlook AddIn In SysTray When Running
Hello,
I would like to put an icon in the Systray to indicate that my Outlook COM AddIn is loaded, and remove the icon whenever the User unloads the AddIn.
All the sample code I've seen requires that you display a form before the icon appears in the SysTray. My AddIn's running in the background initially when loaded - there is no form associated with it until some action triggers it.
I'm using this typical function and getting an error with the "hwnd " variable because there's no window associated with the AddIn. I guess it needs to show up in the Outlook window??
VB Code: 'user defined type required by Shell_NotifyIcon API call Public Type NOTIFYICONDATA cbSize As Long hwnd As Long uId As Long uFlags As Long uCallBackMessage As Long hIcon As Long szTip As String * 64 End Type 'constants required by Shell_NotifyIcon API call: Public Const NIM_ADD = &H0 Public Const NIM_MODIFY = &H1 Public Const NIM_DELETE = &H2 Public Const NIF_MESSAGE = &H1 Public Const NIF_ICON = &H2 Public Const NIF_TIP = &H4 Public Const WM_MOUSEMOVE = &H200 Public Const WM_LBUTTONDOWN = &H201 'Button down Public Const WM_LBUTTONUP = &H202 'Button up Public Const WM_LBUTTONDBLCLK = &H203 'Double-click Public Const WM_RBUTTONDOWN = &H204 'Button down Public Const WM_RBUTTONUP = &H205 'Button up Public Const WM_RBUTTONDBLCLK = &H206 'Double-click Public Declare Function SetForegroundWindow Lib "user32" _ (ByVal hwnd As Long) As Long Public Declare Function Shell_NotifyIcon Lib "shell32" _ Alias "Shell_NotifyIconA" _ (ByVal dwMessage As Long, pnid As NOTIFYICONDATA) As Boolean Public nid As NOTIFYICONDATA Public Sub LoadSystray() With nid .cbSize = Len(nid) .hwnd = Me.hwnd ' ERROR ON THIS LINE- CJ .uId = vbNull .uFlags = NIF_ICON Or NIF_TIP Or NIF_MESSAGE .uCallBackMessage = WM_MOUSEMOVE .hIcon = Me.Icon .szTip = "Your ToolTip" & vbNullChar End With Shell_NotifyIcon NIM_ADD, nidEnd Sub Private Sub UnloadSystray(Cancel As Integer) 'this removes the icon from the system tray Shell_NotifyIcon NIM_DELETE, nid End Sub
Can someone advise me on how to accomplish this correctly? Thank you, CJ
View Complete Forum Thread with Replies
See Related Forum Messages: Follow the Links Below to View Complete Thread
VB6 Addin For Outlook - The Operation Failed On Outlook Startup
Hi,
I am having a strange occurrance of "The operation failed" when I shut down Outlook and reopen it too quickly. Possibly after 5 - 10 seconds I can reopen Outlook safely. It seems as though outlook is taking its time to unload successfully as well as the VB6 written addin. Would there be any way to detect this so that either on .OnConnection or .OnDisconnection? VB.NET has a garbage collector, is there something similar to this that could be written for VB6?
I would appreciate anyone's assistance with this message.
Outlook Addin Help!
I'm trying to develop an Outlook Addin in Visual Basic that places a button on the command bar, and captures the click event without using Office.CommandBars.
I've tried a few samples from the web, but none of them fire the function that I set in .OnAction
i.e. I set
...
.OnAction="=MySub()"
...
Private Sub MySub()
' do something
End Sub
Can anyone help me out with an example of this that works????
Program Running On Systray
Hi friends
anybody can tell me about how to create a program that runs on taskbar
(systra) or in the background
thanks in advance
aravind
Outlook Com Addin Problem
I have written an Outlook Com Addin (VB6) that modifies the body of the mail message being sent. It adds a header to the begining of the message before it is sent. The problem is, if a forwarded message (that has an auto added signature) is sent, another signature is inserted into the message(body) prior to the header I add. If I look at the message during processing it is correct, however when you go back into outlook and open the message the additional siginature is inserted prior to the header. I have not been able to find where (programmatically) I can find how the signature is added and maybe I can turn it off. Any help would be greatly appreciated. Thanks in advance.
Want To Add COM Addin To Word Only, But Not Outlook
I have created an COM addin to Word. However, whenever i oped Outlook, the addin also runs. When outlook is beingd close, I will get an error: "Normal was being edited by another Word session. If you save this document with the original name, you will overwrite any changes made in the other session, xxxxxxxxxxxxx"
How could I prevent addin being run when Outlook is opened? I would like to restrict it to run only when MS Word is opened.
Outlook Addin Possibility
I'm wondering about the possibility of a project I've been thinking about. I want to make an addin for Outlook. At the click of a button, I want an email to be "cleaned" for forwarding. In other words, I'd remove any spaces longer than 2 nbsp, remove line spacing greater than say 2, remove any ">" characters, and do some other general formatting like removing long lists of email addresses.
I know how to do all the formatting stuff, but I'm wondering about the ease of making an addon to Outlook!? If it cannot be created as an Outlook addin, I guess I'll just have to make it as a seperate app.
Thoughts?
Outlook Addin Problem
Hi i ahve a COm addin for outlook in vb6 as part of this addin i need to create a new email and add rich text to the body of the mail, the rich text property is accesed using the outlook redemption file like so:
Dim strRTFMessage As String
strRTFMessage = txtProblem.TextRTF
Dim SafeItem, oItem
Set SafeItem = CreateObject("Redemption.SafeMailItem") 'Create an instance of Redemption.SafeMailItem
Set oItem = Application.CreateItem(0) 'Create a new message
SafeItem.Item = oItem 'set Item property
SafeItem.Recipients.Add "david.oliver@proquis.com"
SafeItem.Recipients.ResolveAll
SafeItem.subject = "Testing Redemption"
SafeItem.Display
SafeItem.BodyFormat = olFormatRichText
SafeItem.RTFBody = strRTFMessage
however when displayed the body of the message appears to be blank? I know the strRTFMessage is populated with rich text,
thanks for any help on this
Outlook 2000 COM Addin
I have a COM addin that adds 2 buttons to the outlook message windows and they seem to work only on the first time I install the add-in, and every time after the event handler for both buttons gets mapped to the first. For example, in the code below button1 pops up a messagebox that says Action1 and button2 pops up a messagebox saying Action2. On the first, after installation, everything works fine, but every time after button2 does nothing and button1 pops up both message boxes. I'm not sure if somehow the inspectors and event handlers are getting mixed up, any help, comments, criticisms, etc. would be greatly appreciated. Thanks in advance.
option Explicit
Implements IDTExtensibility2
Dim goOutlook as Outlook.Application
Dim withevents goInspectors as Outlook.Inspectors 'handle inspector events so we can detect when user is creating a newmail message
Dim withevents Button1 as Office.CommandBarButton 'Action1
Dim withevents Button2 as Office.CommandBarButton 'Action2
'OnConnection - this is called by Outlook when the addin is first connected (loaded)
private Sub IDTExtensibility2_OnConnection(byval Application as Object, byval ConnectMode as AddInDesignerObjects.ext_ConnectMode, byval AddInInst as Object, custom() as Variant)
on error resume next
set goOutlook = Application 'store outlook application object so we can use it later
set goInspectors = goOutlook.Inspectors 'store the inspectors object so we can detect when the user is composing a new mail message
End Sub
private Sub goInspectors_NewInspector(byval Inspector as Outlook.Inspector)
on error resume next
'see if our button already exist on the commandbar
Dim oBar as Office.CommandBar
set oBar = Inspector.CommandBars("Standard")
set Button1 = oBar.FindControl(Type:=msoControlButton, Id:=oBar.Controls("Action1").Id)
set Button2 = oBar.FindControl(Type:=msoControlButton, Id:=oBar.Controls("Action2").Id)
'if they do not, then add it to the controlbar
If Button1 is nothing then
set Button1 = oBar.Controls.Add(Type:=msoControlButton)
Button1.Caption = "Action1"
Button1.ToolTipText = "Action1 message text"
Button1.Tag = "Action1"
Button1.OnAction = "!<myOutlook.Connect>"
End If
If Button2 is nothing then
set Button2 = oBar.Controls.Add(Type:=msoControlButton)
Button2.Caption = "Action2"
Button2.ToolTipText = "Action2 message text"
Button2.Tag = "Action2"
Button2.OnAction = "!<myOutlook.Connect>"
End If
'use the same icon as the Send button for our button
Dim oSendButton as Office.CommandBarButton
set oSendButton = oBar.FindControl(Type:=msoControlButton, Id:=oBar.Controls("Send").Id)
'only try setting the properties if found the Send button
If Not oSendButton is nothing then
Button1.Style = msoButtonIconAndCaption
Button1.FaceId = oSendButton.FaceId
Button2.Style = msoButtonIconAndCaption
Button2.FaceId = oSendButton.FaceId
End If
'only show our button if this is a mail message
If Inspector.CurrentItem.Class = olMail then
Button1.Visible = true
Button2.Visible = true
else
Button1.Visible = false
Button2.Visible = false
End If
End Sub
private Sub Button1_Click(byval Ctrl as Office.CommandBarButton, CancelDefault as Boolean)
on error resume next
MsgBox ("Action1")
End Sub
private Sub Button2_Click(byval Ctrl as Office.CommandBarButton, CancelDefault as Boolean)
on error resume next
MsgBox ("Action2")
End Sub
private Sub IDTExtensibility2_OnStartupComplete(custom() as Variant)
End Sub
private Sub IDTExtensibility2_OnAddInsUpdate(custom() as Variant)
End Sub
private Sub IDTExtensibility2_OnBeginShutdown(custom() as Variant)
End Sub
private Sub IDTExtensibility2_OnDisconnection(byval RemoveMode as AddInDesignerObjects.ext_DisconnectMode, custom() as Variant)
set goOutlook = nothing
set goInspectors = nothing
set Button1 = nothing
set Button2 = nothing
End Sub
private Sub oMyExplorer_Activate()
End Sub
Indication That Application Is Running (using Systray?) [VB6]
I have an application (no form, just a VB.bas module that I load, it is a command line application) but I need some way to indicate that it has started/running/finished.
So I was thinking of adding an icon in the SYSTRAY when the application starts and then remove it when the application is finished processing (this would fix everytihng).
Can I do this? If so how? (I have no clue how to interact with the Systray)
Or if anyone has other suggestions (easier/better) please feel free.
Thanks,
Indication That Application Is Running (using Systray?) [VB6]
I have an application (no form, just a VB.bas module that I load, it is a command line application) but I need some way to indicate that it has started/running/finished.
So I was thinking of adding an icon in the SYSTRAY when the application starts and then remove it when the application is finished processing (this would fix everytihng).
Can I do this? If so how? (I have no clue how to interact with the Systray)
Or if anyone has other suggestions (easier/better) please feel free.
Thanks,
Indication That Application Is Running (using Systray?) [VB6]
I have an application (no form, just a VB.bas module that I load, it is a command line application) but I need some way to indicate that it has started/running/finished.
So I was thinking of adding an icon in the SYSTRAY when the application starts and then remove it when the application is finished processing (this would fix everytihng).
Can I do this? If so how? (I have no clue how to interact with the Systray)
Or if anyone has other suggestions (easier/better) please feel free.
Thanks,
Outlook COM Addin Problem With Installation
I am having a problem distributing my COM addin for Outlook. The program works terrifically, but when I try to package it for distribution using the Visual Studio Installer program, it seems to work but then does not run when as it should when I start Outlook.
I think it may be a problem with the registry settings but cannot seem to pinpoint it. Does the DLL file have to be in a certain place? I have it installed under the Program Files/MyProgram directory.
Any ideas or suggestions would be GREATLY appreciated. Thanks.
Com Addin For Outlook 2003 - Get Body
Hi all, I'm trying to find some information on how to access the subject and body of the current high ligthed mail (or even just the seltext). Anyway it appears that I'm to stupid to use google or the search engine here. Could anybody point out to me where to get this info? Hmm okay its an dll I've done its working fine but I somehow don't get this stuff out of OTL into my DLL. Thanks in advance, Mike
Outlook PropertyPage Calls Addin.Sub?
Hello,
I got a PropertyPage added to the Outlook Options.
To accomplish that I had (?) to create an ActiveX device and needed to compile it.
But now how can I within that PropertyPage a Sub in the real Addin?
(In .NET the property page is in the same projekt as the Addin but in VB 6.0 I was told it has to be a standalone device but still I need the Addin subs)
Thank you,
Mat.
ActiveExplorer Outlook 2003 Com Addin
I am working on a Com Addin in Outlook that works fine in Outlook 2000 and XP. Unfortunately there are problems running it in Outlook 2003. I have tracked down the problem and it is related to the ActiveExplorer object. My project has a class that contains a collection of classes, one instance of the class for each open Explorer. The problem occurs when I am trying to determine which one of the open explorers is the ActiveExplorer. I loop through the my class collection and try to determine which of classes Explorers is the active one. This is even a problem when only one Explorer is open.
Any ideas?
Simmy
Addin - Outlook - Send Button
Hi,
I am trying to write a com addin for outlook that scan the message content after the user click the 'send' button. I have used the wizard and implemented the IDTExtensibility2 and it connects to the outlook. However I don't know how to catch the event when the user clicks the 'send' button. I saw an example from "microeye" website for catching the New message event by implementing "Private Sub goInspectors_NewInspector(ByVal Inspector As Outlook.Inspector) " but it does not work for me.
Any help is highly appriciated
Register AddIn For Outlook Fails
I´ve written a simple sample AddIn for Microsoft Outlook with a reference to MSOUTL9.OLB. When I use this DLL on my machine with Outlook 2003 it works fine. Even a Virtual XP machine with Outlook 2000 works fine (VMWare), but another real PC with Outlook 2000 can´t register the DLL. It comes with:
RegSvr32
DllRegisterServer in \Path...Project_AddIn.dll failed.
Code 0x80004005
After that I thought a distributing file MSI would work. Onfortunely it doesnt, and created the error:
Failed to register: HRESULT -2147467259.
What did I do wrong? This user is Administrator.
Outlook 2003 Com Addin+vb6.0 Usercontrol
i have created a com addin for outlook 2003.i have used ocx project for displaying custom property pages.
i have installed sucesssfully in outlook 2002.
it runs smoothly.
but in 2003 outlook it is giving an error message.
please help me
Outlook Com Addin Launch Msg File
I have .msg file( outlook email) and successfully loaded the msg file into
the outlook in the notes folder. However, I can't launch the loaded email.
Here is how I did in order to launch the outlook note.
Dim otlkDoc as Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMAPIFolder As Outlook.MAPIFolder
Dim objMailItem As Outlook.MailItem
Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objMailItem = otlkDoc.CreateItemFromTemplate(str_FileName)
objMailItem.Move objMAPIFolder
objMailItem.Save
objMailItem .Display 1
Outlook Addin Launching Msg File
I have .msg file( outlook email) and successfully loaded the msg file into
the outlook in the notes folder. However, I can't launch the loaded email.
Here is how I did in order to launch the outlook note.
Dim objNameSpace As Outlook.NameSpace
Dim objMAPIFolder As Outlook.MAPIFolder
Dim objMailItem As Outlook.MailItem
Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderNotes)
Set objNoteItem = otlkDoc.CreateItemFromTemplate(str_FileName)
objNoteItem.Move objMAPIFolder
objNoteItem.Save
objNoteItem.Display 1
ActiveExplorer Outlook 2003 Com Addin
I am working on a Com Addin in Outlook that works fine in Outlook 2000 and XP. Unfortunately there are problems running it in Outlook 2003. I have tracked down the problem and it is related to the ActiveExplorer object. My project has a class that contains a collection of classes, one instance of the class for each open Explorer. The problem occurs when I am trying to determine which one of the open explorers is the ActiveExplorer. I loop through the my class collection and try to determine which of classes Explorers is the active one. This is even a problem when only one Explorer is open.
Any ideas?
Simmy
How To Port VBA Macro Into A VB6 Addin For Outlook
Hi.
With lots of help from Cimperiali I have determined that the only way I can do the projects I was assigned is to port my Outlook VBA macro to the VB6 Addin so that I can add this addin to the Outlook thus it will be "installable" on other PCs without much hastle.
The problem, of course is that I have no experience in programming addins and of course even after I have found that I have to use interface IDTExtensibility2 with its 5 base required functions I still doubt how to make everyting work.
In the macro I have a function in the module with the same name as a macro where everything starts (i call my userforms). Plus in the module I declare all the public variables. Then where would all this go?
Then userforms can be imported into the VB project as well as module, but where do I instantiate them and all that??
If you know any related and helpful info I would be very grateful to hear it. Thank you in advance people.
Outlook Addin Launch The Email( Msg File)
I have .msg file( outlook email) and successfully loaded the msg file into
the outlook in the inbox folder. However, I can't launch the loaded email.
Here is how I did in order to launch the outlook note.
Dim otlkDoc as Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMAPIFolder As Outlook.MAPIFolder
Dim objMailItem As Outlook.MailItem
Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objMailItem = otlkDoc.CreateItemFromTemplate(str_FileName)
objMailItem.Move objMAPIFolder
objMailItem.Save
objMailItem.Display 1
How Access The Function Of A Outlook Com Addin Connect.dsr
I have a public function in the connect.dsr of an outlook addin that populates a combo box on my commandbar with cases#s parsed from an open web page. My addin also has a form that pulls the select case open and I want to have the combobox refresh automatically when I close the form. How can I reference the function in the connect.dsr? I tried moving the function to a module but then it doesn't work at all on the combobox. Is there way to do this?
Outlook 2003 – Addin That Is Sorting Correspondence
I have managed to create an addin that is sending msgbx on connection
Now I need to change it to sort out correspondence on arrival.
Can anyone tell me how to activate addin on email arrival or have addin waiting in background for any incoming messages?
Probelm Deleting Mail In Outlook COM Addin
Have created a COM Addin to remove mail from Outlook (Exchange) to our file system with an option to delete mail once they have been saved. I am using an Outlook View Control but my problem is that mail selected in the normal mailbox window (Generally the top item by default) won't delete and returns an error. I presume this is because it is selected. Any ideas on how I can solve this one?
Creating An Outlook Form Toolbar In An Addin
I'm not having any luck finding an answer to this. I am creating an Outlook 2000 addin. In the OnConnect event it needs to create a toolbar and command button.
I can do this on the main Outlook program, but it would be useful if the user could also have one when viewing the email on the separate form. You can manually add a custom toolbar/button, but not programmatically.
Does anyone know how to access the Toolbars group on the forms?
thanks,
Kevin
Newbie: How To Create An Outlook Addin Button?
Hi,
I am a Delphi programmer but there is a difficulty with Delphi in creating Addins for Outlook (or any office applications), therefore I have invested in Visual basic 6 as I have heard that it is relatively easiy in
VB to create an addin for Outlook.
I need to create an addin that places a button within outlook to save the currently highlighted email into a folder (path to be set via an ini file) and named as the current date&time, eg, 20060806-203010.msg
yyyymmdd-hhmmss
Does anyone have any sample code that does this type of thing as this is the first time that I have ever used VB.
thanks (hopefully).
Jon
Outlook Addin - Adding A Command Bar Button
I am writing an Outlook addin which adds a commandbar button to outlook, and when this button is clicked I would like it to execute a function.
Part of the addin is working that it adds the button, however it is not executing the code when it is clicked.
Here is my code.
Option Explicit
Implements IDTExtensibility2
Public objApp As New Outlook.Application
Public WithEvents oMailItem As Outlook.MailItem
Public WithEvents oExplorer As Outlook.Explorer
Public WithEvents oMailItem2 As Outlook.MailItem
Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
' on start up
Dim oExplorer As Object
Set oExplorer = objApp.ActiveExplorer
'Dim objInspector As ThisOutlookSession.ActiveExplorer
Dim objBars As Object
Set objBars = oExplorer.CommandBars.Item("Standard")
Dim Con As Object
Set Con = objBars.FindControl(Type:=msoControlButton, Id:=1)
If Con.FaceId <> 279 And Con.Caption <> "Junk Mail" Then
Set Con = objBars.Controls.Add(Type:=msoControlButton, Id:=1, Before:=2) 'The button will be number 2, after the mail button
Con.FaceId = 279
Con.Style = msoButtonIconAndCaption
Con.Caption = "Junk Mail"
Con.DescriptionText = "Junk Mail"
Con.OnAction = "JunkMail
MsgBox "addin starting"
End If
End Sub
Function JunkMail()
MsgBox "test"
End Function
For some reason it is not calling the junkmail function when clicked.
what am i doing wrong when i set the onaction property???
This code worked when it was a macro.
Any help with this would be greatly appreciated..
Outlook Addin - OnAction For New Command Bar Button
I am writing an Outlook addin which adds a commandbar button to outlook, and when this button is clicked I would like it to execute a function.
Part of the addin is working that it adds the button, however it is not executing the code when it is clicked.
Here is my code.
Option Explicit
Implements IDTExtensibility2
Public objApp As New Outlook.Application
Public WithEvents oMailItem As Outlook.MailItem
Public WithEvents oExplorer As Outlook.Explorer
Public WithEvents oMailItem2 As Outlook.MailItem
Private Sub IDTExtensibility2_OnStartupComplete(custom() As Variant)
' on start up
Dim oExplorer As Object
Set oExplorer = objApp.ActiveExplorer
'Dim objInspector As ThisOutlookSession.ActiveExplorer
Dim objBars As Object
Set objBars = oExplorer.CommandBars.Item("Standard")
Dim Con As Object
Set Con = objBars.FindControl(Type:=msoControlButton, Id:=1)
If Con.FaceId <> 279 And Con.Caption <> "Junk Mail" Then
Set Con = objBars.Controls.Add(Type:=msoControlButton, Id:=1, Before:=2) 'The button will be number 2, after the mail button
Con.FaceId = 279
Con.Style = msoButtonIconAndCaption
Con.Caption = "Junk Mail"
Con.DescriptionText = "Junk Mail"
Con.OnAction = "JunkMail
MsgBox "addin starting"
End If
End Sub
Function JunkMail()
MsgBox "test"
End Function
For some reason it is not calling the junkmail function when clicked.
what am i doing wrong when i set the onaction property???
This code worked when it was a macro.
Any help with this would be greatly appreciated..
VB6 COM Addin For Outlook -- Memory Leak / Icons
In my COM add-in based on VB6 I have a problem with this statement:
Set itms = frmAAA.ListView1.ListItems.Add(i, , aaStr, 1, 1)
It adds Icon and SmallIcon from an ImageList defined at design time.
But when the add-in trys to shut down, it doesn't go away, it is left in memory.
If I don't use the icons, then a clean shutdown happens.
So, if I instead use:
Set itms = frmAAA.ListView1.ListItems.Add(i, , aaStr)
it shuts down OK.
In my shutdown routine I try doing things like:
frmAAA.ListView1.ListItems.Clear
Set frmAAA.ListView1.Icons = Nothing
Set frmAAA.ListView1.SmallIcons = Nothing
But this doesn't help.
Any ideas on how to fix this and still display the icons?
Type Mismatch Addin Connection Outlook
Hi,
I'm trying to create an Add In for Outlook 2000.
I followed the steps in the microsoft place, and others, but always have the same error.
When the addin is connecting, I place a brekpoint at the first instruction (Set VBInstance = Application) and when I execute that line, I receive a Type mismatch error, code 13.
If I look at the contents of 'Application', it has "Outlook"
and VBInstance is defined as
Public VBInstance As VBIDE.VBE
private Sub AddinInstance_OnConnection(byval Application as Object, _
byval ConnectMode as AddInDesignerObjects.ext_ConnectMode, _
byval AddInInst as Object, custom() as Variant)
'
on error GoTo error_handler
'
'save the vb instance
set VBInstance = Application TYPE MISMATCH
Can anyone help????
Without this I can't go on, and I've been 2 days with this error, and don't know what to do.
Thanks,
Amota.
How To Allow Multiple Users To Access COM Addin Of Outlook
hi
, iam facing a problem with outlook 2003 COM addin,
i created a COM addin for outlook 2003 which extracts the emailid from emails in inbox and gives an option to user to save it to his database.
i logged in a system as admin and i installed that cmponent, i can see the COM bar in outlook, but when login as some other user who doesn't have admin level accesss privelages then it is not showing the COM addin even if i try to add that COM addin by registering it with regsvr32 "..."
it is giving error as the user doesn't have access to Registry
so i want that COM addin to be used by every one i mean the user who has got admin level previlages and as well as limited acess to system without changing the user aceess settings
Outlook Addin Launch The Email( Msg File)
I have .msg file( outlook email) and successfully loaded the msg file into
the outlook in the inbox folder. However, I can't launch the loaded email.
Here is how I did in order to launch the outlook note.
Dim otlkDoc as Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMAPIFolder As Outlook.MAPIFolder
Dim objMailItem As Outlook.MailItem
Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
Set objMailItem = otlkDoc.CreateItemFromTemplate(str_FileName)
objMailItem .Move objMAPIFolder
objMailItem .Save
objMailItem .Display 1
Outlook Addin Put MailItem Into Inbox Folder
I am working on the outlook Com addin. seems like I can't get my email
into Inbox folder. Here is the source.
Dim objApp As Outlook.Application
Dim objNameSpace As Outlook.NameSpace
Dim objMAPIFolder As Outlook.MAPIFolder
Dim objMailItem As Outlook.MailItem
Set objNameSpace = objApp .GetNamespace("MAPI")
Set objMailItem = objApp .CreateItem(olMailItem)
Set objMAPIFolder = objNameSpace.GetDefaultFolder(olFolderInbox)
'load msg file
Set objMailItem = otlkDoc.CreateItemFromTemplate(str_FileName)
objMailItem.Move( objMAPIFolder )
objMailItem.Display (0)
Outlook Addin - Adding Separator To Tools Menu?
Writing a simple addin for Outlook & trying to add a separator to the Tools menu before a number of menu options that will be available to the user. Expected that just setting the caption to "-" as with the menu editor would create the separator, but this doesn't work. Can anyone help?
thanks
Set OLApp = Application
Set OutlookCmdBars = OLApp.ActiveExplorer.CommandBars
'Add buttons to the Tools menu in Outlook, as there are several tools...
Set HookMenuBar = OutlookCmdBars("Tools")
'Separator into the menu first...
Set TmpCmdBarButton = HookMenuBar.Controls.Add(Type:=msoControlButton, Temporary:=True)
TmpCmdBarButton.Style = msoButtonCaption
With TmpCmdBarButton
.Caption = "-"
.Enabled = True
End With
...rest of menu adding code...
Detect MailItem Events For Outlook 2000 Addin
I've started doing an Outlook 2000 addin and everything was going fine untill I was not able to detect events for mailitems.
The events do not fire... What do I need to make them fire?
Thanks
Add A Checkmark To Outlook AddIn On Tools Menu- RESOLVED
Hello,
My DLL COM AddIn for Outlook is listed as a menu item. When the User selects it and some event occurs, I handle the event.
I need to turn the AddIn Off or On based on whether the AddIn menu item is checked or unchecked by the User.
How do I toggle the check mark on and off next to the AddIn - indicating that it is selected or not?
I tried using the Checked property, but I know it can only be used on Menu objects - mine is a CommandBarButton object.
Thanks for any help
CJ
How Do I Send An Email Thru Outlook 98 Whitout Needing To Have Outlook Running?
Does anyone know how to send an email without needing Outlook running?
I have written this code, which works fine when Outlook is running on my machine, but when Outlook is not running I get a MVB error (see attachment mvberror.jpg). When I hit debug it returns me to; Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem). I cant be having this, please help.
CODE:
Dim response
response = MsgBox("Do you want to send a message to Bev telling her you made a copy of " & lstfiles.FileName, vbYesNo, "STOP")
If response = vbYes Then
Dim objOutlook As New Outlook.Application
Dim ObjOutlookMsg As Outlook.MailItem
Set ObjOutlookMsg = objOutlook.CreateItem(olMailItem)
With ObjOutlookMsg
.To = "user@here.com"
.Subject = "test"
.Body = "Bev, " & vbNewLine
.Body = .Body & "I made a copy of drawing number: ** " & lstfiles.FileName
.Body = .Body & " **, from the Bravo folder. " & vbNewLine & vbNewLine
.Body = .Body & "Thanks"
.Send
End With
Set ObjOutlookMsg = Nothing
Set objOutlook = Nothing
Any help would be greatly appreciated,
Thanks in advance,
el guapo
Annoying Problem With MsgBoxes And Focus Of Outlook Application (making A COM Addin)
"MsgBox x" from a dll outlook com addin will result in outlook appear to be "frozen", and the msgbox will appear behind the window.. people might think outlook is crashed because they cant see the msgbox that has loaded behind outlook itself.
"MsgBox x, vbSystemModal" makes the msgbox open in front of outlook so it can be clicked, but it has a tendency to remove focus from outlook completely so that the msgbox is shown with the desktop in the background instead of outlook. Also, it will cause Outlook to not be able to restore focus at all.. Ill click Outlook in the taskbar but it wont appear (but the button on the taskbar will be 'selected').. and rightclicking Outlook on the taskbar shows that 'restore' is greyed out..
Argh.. how can i get the msgbox to show like its supposed to?
Can You Automate Outlook In VB Without Outlook Running?
I give up. I've been looking all day for info about how to automate Outlook in VB without having Outlook running. Whenever you get to the namespace.logon step, it says that it can't find the server. I can't find any way to identify the server to it. Any experts out there?
Office Com Addin Click Addin Button By Program
is there any way to click the button by program?
I have this
Dim WithEvents cbcButton As Office.CommandBarButton
inside of connect.cls. When addin button is clicked
event
Public Sub cbcButton_Click(ByVal ctrl As Office.CommandBarButton, CancelDefault As Boolean)
is called. I want to call this function from module. In order for that,
I have another public g_Button as Office.CommandBarButton in module
and at the IDTExtensibility2_OnStartupComplete I am linking to this global
button by
set g_Button = cbcbutton_Click.
after that inside of this connect class I can call g_Button.execute to call cbcbutton_Click However, if I do the same thing in another module
"fail method "execute" '_CommandBarButton' object message appears and
doesn't do anything?
is there any way to avoid this and click this button by program.
I was wondering if I can click this addin button by sendmessage or sendkey
Let me know if anyone has an idea.
bE
Outlook Addin - Toolbar In "New Mail Message" Window
Hi all,
I want to add toolbar or menu on "new message" window only in outlook 2000 and geater. I can't find any clue on how to add addins only in new message window. The purpose of this plugin is to let user record their voice message and attach it to the mail.
So i have two questions.
1) how can i add toolbar or menu COM addin in "new message" window.
2) how can i attach a file to this currenly open "new message" window.
plz help me in this regard, thanks in advance
Regards,
Naveed.
Systray Menu Appears At Random When Program Is Not In Systray
I have a menu that is only supposed to appear when the icon in the system tray is clicked. It works fine from the system tray. But when I have the program opened the menu will appear at random times and locations. Why?
I put the debug commands in to notifiy me when the event(s) fire. This problem also occurs in all of my other programs that have this code BUT ONLY if there is a right click menu associated with that icon. I have already run Windows Update and installed VB6 SP6.
The code I am using I got from msdn.microsoft.com.
Code:
Private Sub Form_MouseMove(Button As Integer, Shift As Integer, X As Single, Y As Single)
'intDebugCnt is located in the General Declarations section of the form
intDebugCnt = intDebugCnt + 1
Debug.Print MODULE_NAME & "Form_MouseMove" & intDebugCnt
Dim Result As Long
Dim msg As Long
If Me.ScaleMode = vbPixels Then
msg = X
Else
msg = X / Screen.TwipsPerPixelX
End If
Debug.Print "X = " & X
Select Case msg
Case WM_RBUTTONUP
Debug.Print "WM_RBUTTONUP"
'517 - Display popup menu
Result = SetForegroundWindow(Me.hwnd)
Me.PopupMenu Me.mnuSysTray
Case WM_LBUTTONDBLCLK
Debug.Print "WM_LBUTTONDBLCLK"
'515 - Restore frmMain
Me.WindowState = vbNormal
cmdReturnToTray.visible = True
Result = SetForegroundWindow(Me.hwnd)
Me.Show
End Select
End Sub
How Can I Add A Systray Icon And A Systray Menu.
SupZ.... I got as pic that i want to be the systray icon. I dono how to addit. I also need to add clicking options to the icon. ex: If I right click it , a menu pups up and sais about , exit and so on. when left clicked, It restores the program.
Help?
Th,x L8ter
Check If Outlook Is Running
hi i'm a little stuck with a problem i have. i'm trying to check if outlook is running from vb 6.0 using outlook 9.0, and provide a suitable messages if it is'nt.
the second thing is that i need to check for who the email is for and that an email is for a certain domain, to put into a certain folder. for example all emails which end with @yahoo.co.uk, need to go into 'yahoo' folder. and specific folders like Paul or Jim. eg jim@yahoo.co.uk need to go in one folder.
please help, will be greatful for any help out there. cheers!
|