Results 1 to 30 of 30

Thread: I Need Outlook Com Add In Help Needed, Please

  1. #1

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Angry I Need Outlook Com Add In Help Needed, Please

    Problem Specification (draft)

    Functions:
    1)
    To calculate a running total of flexible working hours and show it in
    calendar view based on a reference calendar which is on server in
    "Public Folders" with a name "Standard Working Hours"

    A separate "balance ticket" can be generated as well and user may open
    the balance ticket to get all the required information (daily and
    running
    balance). Runnig total and the updating of changed data may be a bit
    challenging to program !

    Another option is to place the information in the "Tasks" folder of
    the user or some other special "Own Working Hours"

    2)
    To calculate own daily working hours based on a reference calendar
    which is on server in "Public Folders" with a name "Working Hours"

    3)
    To check that there are no overlapping hours (overlapping
    appointments are OK, but the ones starting with an integer are not
    permitted to
    overlap). A RED error ticket may be generated or some other form of
    error
    message should be displayed to the user in error condition.

    4)
    TO make a balance correction - if needed based on special "balance
    correction" appoinment on the day given for the future days

    5)
    To produce a (given time span) report of used working hours to
    specific codenumber or task. This is extra bonus feature.

    Tools:
    1) Outlook-2000 + forms
    2) visual basic


    'My attempted solution

    VB Code:
    1. 'log the user on to the application
    2. strLogonID = Request.ServerVariables("Logon_User")
    3. strMailbox = Right(strLogonID, Len(strLogonID) - InStr(strLogonID, "\"))
    4.  
    5. ' Construct CDO profile
    6. strProfileInfo = strServer + vbLF + strMailbox
    7.  
    8. ' Create CDO session
    9. Err.Clear
    10. On Error Resume Next
    11. Set objSession = Server.CreateObject("MAPI.Session")
    12.  
    13. ' Logon with authenticated CDO profile
    14. Err.Clear
    15. On Error Resume Next
    16. objSession.Logon "", "", False, True, 0, True, strProfileInfo
    17.  
    18. Private WithEvents moOL As Outlook.Application
    19. Private WithEvents moNS As Outlook.NameSpace
    20. Private WithEvents moActiveExplorer As Outlook.Explorer
    21.  
    22. Sub TestColorLabel()
    23.     Dim objItem As Object
    24.     Dim thisAppt As AppointmentItem
    25.    
    26.     Set objItem = Application.ActiveExplorer.Selection(1)
    27.     If objItem.Class = olAppointment Then
    28.         Set thisAppt = objItem
    29.         Call SetApptColorLabel(thisAppt, 3)
    30.     End If
    31.    
    32.     Set objItem = Nothing
    33.     Set thisAppt = Nothing
    34. End Sub
    35.  
    36. Sub SetApptColorLabel(objAppt As Outlook.AppointmentItem, _
    37.                       intColor As Integer)
    38.     ' requires reference to CDO 1.21 Library
    39.     ' adapted from sample code by Randy Byrne
    40.     ' intColor corresponds to the ordinal value of the color label
    41.         '1=Important, 2=Business, etc.
    42.     Const CdoPropSetID1 = "0220060000000000C000000000000046"
    43.     Const CdoAppt_Colors = "0x8214"
    44.     Dim objCDO As MAPI.Session
    45.     Dim objMsg As MAPI.Message
    46.     Dim colFields As MAPI.Fields
    47.     Dim objField As MAPI.Field
    48.     Dim strMsg As String
    49.     Dim intAns As Integer
    50.     On Error Resume Next
    51.    
    52.     Set objCDO = CreateObject("MAPI.Session")
    53.     objCDO.Logon "", "", False, False
    54.     If Not objAppt.EntryID = "" Then
    55.         Set objMsg = objCDO.GetMessage(objAppt.EntryID, _
    56.                                    objAppt.Parent.StoreID)
    57.         Set colFields = objMsg.Fields
    58.         Set objField = colFields.Item(CdoAppt_Colors, CdoPropSetID1)
    59.         If objField Is Nothing Then
    60.             Err.Clear
    61.             Set objField = colFields.Add(CdoAppt_Colors, vbLong, intColor, CdoPropSetID1)
    62.         Else
    63.             objField.Value = intColor
    64.         End If
    65.         objMsg.Update True, True
    66.     Else
    67.         strMsg = "You must save the appointment before you add a color label. " & _
    68.                  "Do you want to save the appointment now?"
    69.         intAns = MsgBox(strMsg, vbYesNo + vbDefaultButton1, "Set Appointment Color Label")
    70.         If intAns = vbYes Then
    71.             Call SetApptColorLabel(objAppt, intColor)
    72.         End If
    73.     End If
    74.                      
    75.     Set objMsg = Nothing
    76.     Set colFields = Nothing
    77.     Set objField = Nothing
    78.     objCDO.Logoff
    79.     Set objCDO = Nothing
    80.  
    81. Sub AddHours()
    82. Dim i As AppointmentItem
    83. Dim h As Single
    84. 'totals the hours for selected appointmentItems
    85. h = 0
    86. For Each i In ActiveExplorer.Selection
    87. h = h + DateDiff("n", i.Start, i.End)
    88. Next i
    89. MsgBox Format(h / 60, "0.0") & " Hours", vbInformation, "Total Hours"
    90. End Sub


    //This doesnt work...I have been trying to debug but to no avail, just highlighting so many errors. I guessed I need to develop a COM ADD IN...I dont know much about this, even I tried running downloaded samples from this site but couldnt get it to run, but dont know how to go about this. Any help would be greatly appreciated. thanks in advance
    Last edited by RobDog888; Oct 26th, 2006 at 01:18 AM. Reason: Added [vbcode] tags

  2. #2
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    To start, appointment color labels only work on Outlook 2002 and above.

    You say it doesnt work but lets look at one issue at a time.

    After describing the problem, whats the first problem we should solve?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  3. #3

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    To start, appointment color labels only work on Outlook 2002 and above.

    You say it doesnt work but lets look at one issue at a time.

    After describing the problem, whats the first problem we should solve?

    Thanks for your response.
    To start, appointment color labels only work on Outlook 2002 and above.
    Thats why i am confused

    You say it doesnt work but lets look at one issue at a time.
    I tried to compile and run your own Add In you put on the tutorials, but got just errors...makes it even more difficult for me to do mine .

    After describing the problem, whats the first problem we should solve?
    calculate the total flexible hours,
    here i did like this:

    VB Code:
    1. Sub AddHours()
    2. Dim i As AppointmentItem
    3. Dim h As Single
    4. 'totals the hours for selected appointmentItems
    5. h = 0
    6. For Each i In ActiveExplorer.Selection
    7. h = h + DateDiff("n", i.Start, i.End)
    8. Next i
    9. MsgBox Format(h / 60, "0.0") & " Hours", vbInformation, "Total Hours"
    10. End Sub

    Do you think datetimedifference would be better or this?

    VB Code:
    1. Function DateSpan(colItems As Outlook.Items, _
    2.                   dteStart As Date, dteEnd As Date) _
    3.                   As Outlook.Items
    4.     Dim colSpanItems As Outlook.Items
    5.     On Error Resume Next
    6.     colItems.Sort "[Start]"
    7.     colItems.IncludeRecurrences = True
    8.     strFind = "[Start] <= " & _
    9.               Quote(Format(dteEnd, "ddddd") & " 11:59 PM") & _
    10.               " AND [End] > " & _
    11.               Quote(Format(dteStart, "ddddd") & " 12:00 AM")
    12.     'MsgBox strFind
    13.     Set colSpanItems = colItems.Restrict(strFind)
    14.     If Err = 0 Then
    15.         Set DateSpan = colSpanItems
    16.     End If
    17.     Set colSpanItems = Nothing
    18. End Function

    I am in a quandary,please help. Do you think customization of outlook is better than COM ADD IN for this?

  4. #4
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    I have a few AddIn examples for VB 6 and VB.NET. Which did you use?
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  5. #5

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    I have a few AddIn examples for VB 6 and VB.NET. Which did you use?
    I used this one vb6:

    http://www.vbforums.com/showthread.php?t=406641


    Anyway the whole Add in stuff is confusing to me. I have see and gone through so many templates but they look differently as well. For example, when I looked through CDOlive's phonechanger example it looks different from Microeye's ItemCB which also look differently from microsoft's and yours also look different from all of them.
    The more reason why i got confused. I tried to modify the ItemCB,microsoft,yours,phonechanger but to no avail
    I never thought this project would strech me this far, it looks quite simple, but then its been complex as i tried so many methods.Please you are my only hope now,my supervisor is unfortunately clueless here as well

  6. #6
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    Ok, welll everyone has their own way of doing things and they all work.

    Lets start with my faq example. If you followed all the steps and pasted the code did it compile? Did you get to add it via the COM AddIn s button oin Outlook. What was the error?

    Lets get it to work just as the example shows first before making other modifications.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  7. #7

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Angry Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    Ok, welll everyone has their own way of doing things and they all work.

    Lets start with my faq example. If you followed all the steps and pasted the code did it compile? Did you get to add it via the COM AddIn s button oin Outlook. What was the error?

    Lets get it to work just as the example shows first before making other modifications.
    When 'Add In' is selected as the project.Anyway I dont know if i was supposed to add some buttons or not.
    But i got : Compile Error:Object does not source automation event("Public WithEvents moCBMeow As Office.CommandBarButton" was highlighted).

    But when I select COM Add In, it compiles without error, but thats when I comment out:"Implements IDTExtensibility2" and "'Public WithEvents moCBMeow As Office.CommandBarButton" from the modules code where i pasted them.But then I follow the process to see it through outlook but nothing shows . I am losing my mind now . Please help me out here

  8. #8
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    Ok if you only have the code from the FAQ in there and set the combo dropdowns on the designer to Outlook xx.0 and the load behavior combo then it should be good to compile. Did you add the references mentioned in the FAQ?

    Quote Originally Posted by FAQ
    Option Explicit
    'Added references:
    'Microsoft Office xx.0 Object Library
    'Microsoft Outlook xx.0 Object Library
    'Microsoft AddIn Designer
    'Microsoft Visual Basic 6.0 Extensibility
    Implements IDTExtensibility2
    '...
    '...
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  9. #9
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    I added a zip project example of the FAQ on the FAQ thread for you - http://vbforums.com/showthread.php?t=406641

    Note: You can ONLY add the AddIn via the COM AddIn button as described in the FAQ
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  10. #10

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    I added a zip project example of the FAQ on the FAQ thread for you - http://vbforums.com/showthread.php?t=406641

    Note: You can ONLY add the AddIn via the COM AddIn button as described in the FAQ
    Thanks for the zip file and your efforts and time...i really appreciate it.

    Which of the following 3 VB Projects is needed for any COM Add In?:

    (1)ActiveXDll
    (2)AddIn
    (3)COM ADD IN.

    Some of the examples I have seen, use either the first or the second, but then I could only compile with the third, thats why its too confusing, please direct/advice me

  11. #11

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    I added a zip project example of the FAQ on the FAQ thread for you - http://vbforums.com/showthread.php?t=406641

    Note: You can ONLY add the AddIn via the COM AddIn button as described in the FAQ
    The zip file is still pending approval...so I cant download it yet, but i will wait

  12. #12
    Super Moderator si_the_geek's Avatar
    Join Date
    Jul 2002
    Location
    Bristol, UK
    Posts
    41,974

    Re: I Need Outlook Com Add In Help Needed, Please

    I've approved the attachment (I haven't checked it, but I think we can trust RobDog!).

  13. #13
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    You can create a COM AddIn with either #1 or #2.

    The compiled finished version is the dll file.

    Let me know if you have any questions.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  14. #14

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    You can create a COM AddIn with either #1 or #2.

    The compiled finished version is the dll file.

    Let me know if you have any questions.
    After extracting the zip file, I tried to run the project file and I had the same error:" Compile Error:Object does not source automation event("Public WithEvents moCBMeow As Office.CommandBarButton" was highlighted)
    ".

    What should i do?

  15. #15

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by si_the_geek
    I've approved the attachment (I haven't checked it, but I think we can trust RobDog!).
    Thanks a bunch, ive downloaded it already

  16. #16

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    You can create a COM AddIn with either #1 or #2.

    The compiled finished version is the dll file.

    Let me know if you have any questions.
    Can't with #3? Its even written COM ADD IN

  17. #17
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    There is no COM AddIN project type in VB 6 Enterprise.

    To add an AddIn via the COM button in Outlook it needs to be written in C++ I believe. For VB 6 or VB.NET you need to add your AddIn via the COM AddIns button.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  18. #18

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Angry Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    There is no COM AddIN project type in VB 6 Enterprise.

    To add an AddIn via the COM button in Outlook it needs to be written in C++ I believe. For VB 6 or VB.NET you need to add your AddIn via the COM AddIns button.
    I am using Miscrosft Visual studio 6.0...professional edition, i got it from school. it has COM ADD IN project.And when I tried to use it, it has already all those Onconnecttion()....OnStartUpcomplete(),I tried to copy and paste it for you to see, but i couldnt. .
    Anyway, How do you suggest I go about my project at hand?
    The phonechanger i downloaded compiled without errors, but I couldnt see anything.
    I want to see if i could modify that one.
    but seriously,am blank here
    Lets concentrate on my project now
    I have tried to solve it but have so many ways but i dont know how which one to follow.
    Please help by giving me some ideas, or snippets.
    I dont even know how to program the tickets nos.
    By the way, it takes me time to reply because i am not in the USA

  19. #19
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    Have you even downloaded my FAQ code example attachment that I uploaded for you? You should be able to get that working and then we can expand on that to fit your project needs.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  20. #20

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    Have you even downloaded my FAQ code example attachment that I uploaded for you? You should be able to get that working and then we can expand on that to fit your project needs.
    Yes I have:

    Quote Originally Posted by okaka
    After extracting the zip file, I tried to run the project file and I had the same error:" Compile Error:Object does not source automation event("Public WithEvents moCBMeow As Office.CommandBarButton" was highlighted)
    ".

    What should i do?

  21. #21

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    There is no COM AddIN project type in VB 6 Enterprise.

    To add an AddIn via the COM button in Outlook it needs to be written in C++ I believe. For VB 6 or VB.NET you need to add your AddIn via the COM AddIns button.
    I am using VB6, and it has three projects for ADD IN:
    ActiveXDLL
    AddIN
    COM ADD IN.

    when you said COM ADDINs button, as in your last statement did you mean:
    the third project(COM ADD IN)? .

    To open your COM ADD IN FAQs files, should I use the #1,or #2 or #3, as I have VB6 and not enterprise edition?

  22. #22

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    I have observed the following:
    When ActiveX DLL is used, the PROJECT window has only CLASS MODULE
    With AddIN I see:
    MyAddin-Forms-Designers
    With COM ADD IN there is:
    MyOutlookAddin(MyOutlookAddin)-Modules...ModOutlook(ModOutlook)-Class Modules...OutAddin(OutAddin)-Designers...Connect(Connect).

    These are how they all appear when each is chosen as the project in the VB 6 IDE

  23. #23

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    I still get the same error as before when i tried to compile the file.
    I have referenced all you said, but still no success.
    What do you suggest i do?

  24. #24
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    If you downloaded my attachment then you should just have to open it by double clicking it. Check for missing references or update them to your versions.

    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  25. #25

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    If you downloaded my attachment then you should just have to open it by double clicking it. Check for missing references or update them to your versions.

    I have CDO.dll missing. I think thats the reason. I will fix it, just dont have the correct version of the CDO.dll that i downloaded it says its different version. I thought it installs at the same time with outlook, but i have observed it doesnt. I have to get it from my office cd or comment out those parts that require cdo. thanks

  26. #26

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    If you downloaded my attachment then you should just have to open it by double clicking it. Check for missing references or update them to your versions.

    Sorry I still get "object does not source automation error"..."Public WithEvents moCBMeow As Office.CommandBarButton". I have installed the cdo.dll and made all the references but still couldnt get it to run.
    After extraction i have the following files:"Connect.DCA, VB Designer Module,,VB Project,LIB,EXP and DLL".
    When I tried to open the VBP on the project window only the Designers proj file is shown.Is there anything i am missing?

    "Copy the "ADDIN.DSR" designer form found in "?:\Program Files\Microsoft Visual Studio\VB98\Template\Projects" and paste it into your current project folder so you are NOT working with the actual original template file.
    "

    I tried to uncomment these:"Microsoft Office 8.0 Object Library
    Microsoft Outlook 9.0 Object Library
    Microsoft AddIn Designer
    Microsoft Visual Basic 6.0 Extensibility"
    But then it says compiler error:expected:end of statement.I dont know what that means, the text colors were red instead of black

    I dont understand the above statement, because your project already has ADDIN.DSR

  27. #27
    Ex-Super Mod RobDog888's Avatar
    Join Date
    Apr 2001
    Location
    LA, Calif. Raiders #1 AKA:Gangsta Yoda™
    Posts
    60,709

    Re: I Need Outlook Com Add In Help Needed, Please

    So according to your PM it compiles now?

    What is the Office version your using now?

    cdo.dll should be available from your Office cd and should be installed by going to your control panel and clicking Add/Remove programs. Then select Office and change or modify installation. Then select the option under the optional components, I think it was as its hard to remember office 2000 and before, thenyou will not only get the dll but all the dependancy files asocuiated with the cdo.dll file.
    VB/Office Guru™ (AKA: Gangsta Yoda®)
    I dont answer coding questions via PM. Please post a thread in the appropriate forum.

    Microsoft MVP 2006-2011
    Office Development FAQ (C#, VB.NET, VB 6, VBA)
    Senior Jedi Software Engineer MCP (VB 6 & .NET), BSEE, CET
    If a post has helped you then Please Rate it!
    Reps & Rating PostsVS.NET on Vista Multiple .NET Framework Versions Office Primary Interop AssembliesVB/Office Guru™ Word SpellChecker™.NETVB/Office Guru™ Word SpellChecker™ VB6VB.NET Attributes Ex.Outlook Global Address ListAPI Viewer utility.NET API Viewer Utility
    System: Intel i7 6850K, Geforce GTX1060, Samsung M.2 1 TB & SATA 500 GB, 32 GBs DDR4 3300 Quad Channel RAM, 2 Viewsonic 24" LCDs, Windows 10, Office 2016, VS 2019, VB6 SP6

  28. #28

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    So according to your PM it compiles now?

    What is the Office version your using now?

    cdo.dll should be available from your Office cd and should be installed by going to your control panel and clicking Add/Remove programs. Then select Office and change or modify installation. Then select the option under the optional components, I think it was as its hard to remember office 2000 and before, thenyou will not only get the dll but all the dependancy files asocuiated with the cdo.dll file.
    Yes it compiles, i have been playing with it, by changing the load behaviours to see how they differ.I am relieved now
    Iam using MS09.DLL(version 9.0).

  29. #29

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    So according to your PM it compiles now?

    What is the Office version your using now?

    cdo.dll should be available from your Office cd and should be installed by going to your control panel and clicking Add/Remove programs. Then select Office and change or modify installation. Then select the option under the optional components, I think it was as its hard to remember office 2000 and before, thenyou will not only get the dll but all the dependancy files asocuiated with the cdo.dll file.
    MS Office 2000, because I am building outlook 2000 application. My OS is XP professional however...i dont know if that was the problem, but after re-installing the files by updating the cdo.dll, everything works fine now. it compiles and runs. Thanks...am so excited..beginning to get a grip of the COM ADD IN now

  30. #30

    Thread Starter
    Lively Member
    Join Date
    Mar 2006
    Posts
    79

    Re: I Need Outlook Com Add In Help Needed, Please

    Quote Originally Posted by RobDog888
    So according to your PM it compiles now?

    What is the Office version your using now?

    cdo.dll should be available from your Office cd and should be installed by going to your control panel and clicking Add/Remove programs. Then select Office and change or modify installation. Then select the option under the optional components, I think it was as its hard to remember office 2000 and before, thenyou will not only get the dll but all the dependancy files asocuiated with the cdo.dll file.

    Please I am waiting for the next step to take as it regards my project

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width