Results 1 to 2 of 2

Thread: Email

  1. #1

    Thread Starter
    Fanatic Member
    Join Date
    Oct 2000
    Location
    Seattle
    Posts
    954
    OK this is my situation. I have an application that does the following:

    1. Queries a folder and places the names of the files in the folder in a combo box

    2. Has text boxes that when filled and a command button named "Submit" is clicked will place that information into an Access DB

    3. Copies the file from the current directory, renames it and deletes it out of the first directory.

    This is what it does currently. What I would like it to do is also email the file to a specified email address prior to moving it. My problem is I have not done this before but more important we are currently using GroupWise 5.5 but in the very near future we are migrating to Outlook and Exchange. I have been fighting with the idea of using the GroupWise active x objects because I would have to rewrite it so soon for Outlook. On top of that when I put the GW active x objects on my form and run it just to see what it does it crashes VB. Does anyone have any suggestions for me???

    Thank you very much,

    Brian

  2. #2
    Hyperactive Member
    Join Date
    Jun 2000
    Location
    NY
    Posts
    497

    starting point maybe....

    I have just gotten into the world of email. On my way in, I found that there's a ShellExecute API option that launches the default email application. I've used the code below which gets my Outlook 2000 application to bring up the new message dialog, but I have to manually hit the SEND button to push it on its way. The other problem I have somtimes is that the entire contents of my subject and body text do not always appear.

    Maybe you can work with it to figure out what it does & make it work better. I tried but could not find where I saw it in MSDN. (I have since recoded to work with Outlook objects.)

    ' Put in declarations
    Private Declare Function ShellExecute Lib "shell32.dll" _
    Alias "ShellExecuteA" _
    (ByVal hwnd As Long, _
    ByVal lpOperation As String, _
    ByVal lpFile As String, _
    ByVal lpParameters As String, _
    ByVal lpDirectory As String, _
    ByVal nShowCmd As Long) As Long

    ' For above shell function.
    Private Const SW_SHOW = 5

    ' Use this to send an email to persons in m_sSendTo,
    ' with subject m_sSubject, and message m_sBody.

    ShellExecute hwnd, "open", _
    "mailto:" & m_sSendTo & _
    ?subject=" & m_sSubject & _
    "&body=" & m_sBody, _
    vbNullString, vbNullString, SW_SHOW

    I remember the MSDN article where I found this mentioned that "mailto:" was the thing that launched the default mail application.

    Good luck!
    end war
    stop greed

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