473,408 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,408 software developers and data experts.

Help Needed in Visual basic coding

75
Hi All,
I have written a code that finds default mail client and then i am using a function to open a mail client and populating it with values.The code works fine when i give some minimum value for the BODY field of the mail.But when i pass String Values with large amount of data the code is not working out.What is this problem due to?I have attached the code below

Expand|Select|Wrap|Line Numbers
  1. Option Explicit
  2. Private Declare Function ShellExecute Lib "shell32.dll" Alias _
  3. "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation _
  4. As String, ByVal lpFile As String, ByVal lpParameters _
  5. As String, ByVal lpDirectory As String, _
  6. ByVal nShowCmd As Long) As Long
  7.  
  8. Private Const SW_SHOW = 5
  9.  
  10.  
  11. Public Function OpenEmail(ByVal EmailAddress As String, _
  12.     Optional Subject As String, Optional Body As String) _
  13.     As Boolean
  14.     Dim lWindow As Long
  15.     MsgBox Body
  16.     Dim lRet As Long
  17.     Dim sParams As String
  18.     sParams = EmailAddress
  19.     If LCase(Left(sParams, 7)) <> "mailto:" Then _
  20.         sParams = "mailto:" & sParams
  21.  If Subject <> "" Then sParams = sParams & "?subject=" & Subject
  22.     If Body <> "" Then
  23.         sParams = sParams & IIf(Subject = "", "?", "&")
  24.         sParams = sParams & "body=" & Body
  25.         MsgBox sParams
  26.          End If
  27.    lRet = ShellExecute(lWindow, "open", sParams, _
  28.     vbNullString, vbNullString, SW_SHOW)
  29.    OpenEmail = lRet = 0
  30. End Function
  31.  
  32.  
  33. Private Sub Command2_Click()
  34. Call OpenEmail("ananth_r@xyz.com", "Mac-ID", software_result)
  35. Unload Me
  36. End Sub
please help me in this regard
Feb 22 '07 #1
2 940
willakawill
1,646 1GB
Hi. What is software_result and where is it declared?
Feb 22 '07 #2
Killer42
8,435 Expert 8TB
Two more questions:
  1. In what way, precisely, does it "not work"? We need specific details.
  2. Are you sure the text you're passing doesn't include characters that might confuse things? For example, what if the text contained "?body=" or something?
Feb 23 '07 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

9
by: sleepyant | last post by:
Hi, I've posted this question on several forum but have no response. So I hope anyone who have any idea what I'm talking about please give your solution or advice. My problem is I need to check...
4
by: Terencetrent | last post by:
I having been using Access '97/2002 for about 4 years now and have never really had the need or the time to learn visual basic. Well, I think the time has finally come. I need help with Visual...
7
by: Corepaul | last post by:
Missing Help Files When I enter "recordset" as the keyword and search the Visual Basic Help index, I get many topics of interest in the resulting list. But there isn't any information available...
32
by: robert d via AccessMonster.com | last post by:
I'm looking at converting DAO to ADO in my app. All of my DAO connections are of the following structure: Dim wsName As DAO.Workspace Dim dbName As DAO.Database Dim rsName As DAO.Recordset ...
53
by: Hexman | last post by:
Hello All, I'd like your comments on the code below. The sub does exactly what I want it to do but I don't feel that it is solid as all. It seems like I'm using some VB6 code, .Net2003 code,...
4
by: perryschon | last post by:
Can someone please help me out with the Visual Basic source code needed that allows configuration and usage of comm ports in any PC? I am constructing an asynchronous serial communication RS-232...
31
by: Mark Dufour | last post by:
Hi all, I have recently released version 0.0.20 and 0.0.21 of Shed Skin, an optimizing Python-to-C++ compiler. Shed Skin allows for translation of pure (unmodified), implicitly statically typed...
2
by: astrogirl77 | last post by:
Hi, I'm new to Python and am hoping to find help with coding a Python script, applet. I code in an old version of Visual Basic 4.0, I have a simple app that is about 3 and a half pages of code...
1
by: astrogirl77 | last post by:
I'm new to C++ and am hoping to find help with coding a simple C program, am wanting to obtain code and functioning exe's. I code in an old version of Visual Basic 4.0, I have a simple app that...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.