dcsimg
Results 1 to 6 of 6

Thread: Open program with parameters from Outlook

  1. #1

    Thread Starter
    Junior Member
    Join Date
    May 2007
    Posts
    27

    Open program with parameters from Outlook

    Hey,

    I want to sent an e-mail containing a link to a program. This program needs to receive a parameter with the news-id. Opening the program is no problem but when I add a parameter it doesn't work anymore.
    Running the program from the command line with the parameter is no problem but when I use the link in an e-mail it fails. The error says that the file couldn't be found.
    Here is the command: "H:\programs\programNewsflash.exe 125"
    The e-mails are created and automatically sent in a vb.net program.

    Thanks

  2. #2
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: Open program with parameters from Outlook

    Watermeloene:

    I believe you have to use an API call to the OS to pass command line parameters to a VBA program. I was able to us this successfully to pass command line parameters to an Excel VBA program (Macro). There was a post to me regarding this a year or so ago. I'll look it up and pass it along to you.
    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

  3. #3
    Frenzied Member
    Join Date
    May 2004
    Location
    Carlisle, PA
    Posts
    1,045

    Re: Open program with parameters from Outlook

    Blessings in abundance,
    All the Best,
    & ENJOY!

    Art . . . . Carlisle, PA . . USA

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

    Re: Open program with parameters from Outlook

    Seems that Outlook is interpreting the parameter as part of the file/path of the program to execute. Receiving th eparameter doesnt seem to be the problem here.

    Have you tried wrapping the parameter in double quotes?
    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
    Junior Member
    Join Date
    May 2007
    Posts
    27

    Re: Open program with parameters from Outlook

    The first thing with the API I don't quite understand. I don't think this is what I want to achieve.
    The second thing: yes, I tried with double quotes. I also tried with %20 instead of a blank space and some other simple solutions but they all don't seem to help.

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

    Re: Open program with parameters from Outlook

    Did you read/try the link in #3?
    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
  •  



Featured


Click Here to Expand Forum to Full Width