How to insert line break for send whatsapp message using vb.net

Thisara Udayanga 21 Reputation points
2022-07-30T16:17:20.2+00:00

I want to send whatsapp message like below using VB.net

LAUNDRY HOMES
Invoice Number : 100006
Invoice Date : 07/30/2022

I have used following code but its not line breaking in whatsapp
Dim web As New WebBrowser

Dim strMessage As String

strMessage = LblCompany.Text & Environment.NewLine & "Invoice Number : " & txtInvoiceno.Text & Environment.NewLine & "Invoice Date : " & DtInvdate.Value.ToString("MM/dd/yyyy") & ""

web.Navigate("whatsapp://send?phone=" & txtcontact.Text & "&text=" & strMessage & "")

Help me how to do line break.

VB
VB
An object-oriented programming language developed by Microsoft that is implemented on the .NET Framework. Previously known as Visual Basic .NET.
2,760 questions
0 comments No comments
{count} votes

3 answers

Sort by: Most helpful
  1. Sreeju Nair 12,456 Reputation points
    2022-07-30T17:20:16.283+00:00

    To send the linebreak, try using %0a
    e.g.

    strMessage = LblCompany.Text & "%0a" & "Invoice Number : " & txtInvoiceno.Text & "%0a" & "Invoice Date : " & DtInvdate.Value.ToString("MM/dd/yyyy") & ""  
    web.Navigate("whatsapp://send?phone=" & txtcontact.Text & "&text=" & strMessage & "")  
    
    1 person found this answer helpful.

  2. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.


    Comments have been turned off. Learn more

  3. Deleted

    This answer has been deleted due to a violation of our Code of Conduct. The answer was manually reported or identified through automated detection before action was taken. Please refer to our Code of Conduct for more information.

    2 deleted comments

    Comments have been turned off. Learn more

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.