Results 1 to 10 of 10

Thread: How to send Mail Item manually

  1. #1

    Thread Starter
    Hyperactive Member Bajrang's Avatar
    Join Date
    Oct 2006
    Posts
    309

    How to send Mail Item manually

    Hi, All
    I m creating an Addin to check whether user has not filled any recipient of the Mail. In this case (if user has left all of its recipients blank), I want to send my mails to a specefied email address.
    I have written the code for it in myOLApp_ItemSend but problem is that
    when I leave blank all its recipient then a message comes .
    "There must be at least one name or distribution list in the TO,cc,bcc Box" .
    My code executes after this message.
    I don't want this message and want to execute my code written in
    myOLApp_ItemSend Procedure.
    Any help is appriciated
    Thanks
    Using .NET 3.5 (VS 2008) And XP SP2

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

    Re: How to send Mail Item manually

    If they leave the To blank and you have a CC or BCC I would suggest that when its blank you substitute your email address in the to and be done with it.
    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
    Hyperactive Member Bajrang's Avatar
    Join Date
    Oct 2006
    Posts
    309

    Re: How to send Mail Item manually

    I want to check when user leave blank To,CC,BCC then this mail should go to a particular email Address, without giving any message.
    Currently my problem is that whenever user leave blank To,CC,BCC then that message appears.
    Using .NET 3.5 (VS 2008) And XP SP2

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

    Re: How to send Mail Item manually

    Hmm, havent tested it but does the ItemSend event still fire before the error msg comes up?
    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
    Hyperactive Member Bajrang's Avatar
    Join Date
    Oct 2006
    Posts
    309

    Re: How to send Mail Item manually

    No sir,
    Actually when I want to send a mail leaving to,cc,bcc fields blank, then that message appears(after clicking the SEND button) and after that my code executes that is written in myOlApp_ItemSend Procedure.
    My requirements is that I want to leave blank to,cc,bcc and want to send mail to a default recipient that is given in my code.
    but when I leave blank to,cc,bcc that message appears and I have to enter something in anyone field, otherwise this message appears again and again, that I don't want.
    I don't know how to stop it.
    Please reply me soon
    Using .NET 3.5 (VS 2008) And XP SP2

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

    Re: How to send Mail Item manually

    If the msg is popping up first before the code execute s the item send event then you cant do it from managed/automation code. You will need to modify the Outlook Form and add VB Script code to the event and see if it fires before the error msg. I doubt that it will but could be worth a try.
    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
    Hyperactive Member Bajrang's Avatar
    Join Date
    Oct 2006
    Posts
    309

    Re: How to send Mail Item manually

    Thanks RobDog
    could you explain the managed/automation code. or
    any sample or helping hints.
    Thanks again
    Using .NET 3.5 (VS 2008) And XP SP2

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

    Re: How to send Mail Item manually

    Heres my FAQ on customizing

    How do I customize an Outlook Form?
    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

    Thread Starter
    Hyperactive Member Bajrang's Avatar
    Join Date
    Oct 2006
    Posts
    309

    Re: How to send Mail Item manually

    Thanks a lot for reply RobDog But As I know Outlopk's Message form cannot be customized.
    AM I right.
    anyways what is the event that cause that popup to appear. If this can be catch ,
    then rest of thing is ok.
    Any Idea??
    Using .NET 3.5 (VS 2008) And XP SP2

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

    Re: How to send Mail Item manually

    So you didnt see my FAQ link I posted in the post above?

    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

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