Results 1 to 8 of 8

Thread: default email client is not popping up on click in win98

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    could it be an issue with certain versions of win98?
    Why did I ever start learning VB?! I should have been happy with Java.

  2. #2
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Try this :

    VB Code:
    1. Option Explicit
    2.  
    3. Private Declare Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _
    4. (ByVal hwnd As Long, ByVal lpszOp As String, _
    5. ByVal lpszFile As String, ByVal lpszParams As String, _
    6. ByVal LpszDir As String, ByVal FsShowCmd As Long) _
    7. As Long
    8. Private Declare Function GetDesktopWindow Lib "user32" () As Long
    9. Private Const SW_SHOWNORMAL = 1
    10.  
    11.  
    12. Private Sub Form_Load()
    13.     StartDoc "mailto:?Subject=How? &Body=Thank you"
    14. End Sub
    15.  
    16. Public Function StartDoc(DocName As String) As Long
    17.     ShellExecute GetDesktopWindow(), "Open", DocName, "", "C:\", 1
    18. End Function
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    I hate VB. I tried your code and it works perfect but the message that appears in the body section is quite a number of sentences, 531 characters to be precise and maybe because the ShellExecute method takes a strings as an argument, it limits it to 255 characters. I am in deep trouble if I can not get this to work as the deadline is this afternoon.
    Thanks
    Why did I ever start learning VB?! I should have been happy with Java.

  4. #4
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    A fixed-length string can store about 64,000 characters, and a variable length string can store about 2 billion characters.

    I think you're safe
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  5. #5

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    why is it working differently on different platforms?
    on 2000pro the entire message is displayed in my email client, in NT it displays only 210 characters and in 98 I am not sure how many because when I ran the program with the entire message it did not work but when I ran it with a small sentence, it did.
    I can only assume then that it is the "ShellExecute" fault.

    Can anyone suggest a solution pls
    Why did I ever start learning VB?! I should have been happy with Java.

  6. #6

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    is this a question for the api forum maybe?
    Why did I ever start learning VB?! I should have been happy with Java.

  7. #7
    Retired VBF Adm1nistrator plenderj's Avatar
    Join Date
    Jan 2001
    Location
    Dublin, Ireland
    Posts
    10,359
    Hmm.
    Try putting the entire message into a String Variable first, and then passing that variable name into the API then...
    Microsoft MVP : Visual Developer - Visual Basic [2004-2005]

  8. #8

    Thread Starter
    Junior Member
    Join Date
    Aug 2001
    Location
    London
    Posts
    31
    unfortunatelly it did not work. It must be the api method
    Why did I ever start learning VB?! I should have been happy with Java.

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