UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome to UtterAccess! Please ( Login   or   Register )

Custom Search
 
   Reply to this topicStart new topic
> Break Line Not Coming, Any Version    
 
   
arun.ms0910
post Jun 28 2019, 09:43 AM
Post#1



Posts: 19
Joined: 19-June 19



Hi Expert,

My Client mail format pasted in excel Range B2 cell.i have try send mail automatically try get the body of the mail in Range B2 and Signature. but pasted in paragraph not break line coming in body of the mail.

i need excel format in my outlook please help me..

some times lot of line mail format will come

My code is:

Sub Mail_Sending()
'On Error Resume Next
'Dim myDelegate As Outlook.Recipient
Dim olapp As Outlook.Application
Set olapp = New Outlook.Application
Dim olmail As Outlook.MailItem
Dim i As Double
Dim Y As Double

Open (Environ("appdata") & "\Microsoft\Signatures\TRC.htm") For Input As #1
strSignature = Input(LOF(1), #1)

Range("a100").Select
Selection.End(xlUp).Select
Y = Selection.Row
For i = 2 To Y
Bod_of_Mail = Range("C2").Value
Set olmail = olapp.CreateItem(olMailItem)
With olmail
.Display
.Body = Cells(i, 3).Value
.HTMLBody = Bod_of_Mail & "<br>" & strSignature & "<br>"
.To = Cells(i, 4).Value
.CC = Cells(i, 5).Value
.Recipients.ResolveAll
.Subject = Cells(i, 6).Value
.Attachments.Add Cells(i, 7).Value
.h
End With

Next
End Sub


Attached File(s)
Attached File  Capture.JPG ( 42.52K )Number of downloads: 5
Attached File  Capture.JPG ( 42.52K )Number of downloads: 4
Attached File  Capture2.JPG ( 64.38K )Number of downloads: 6
 
Go to the top of the page
 
cheekybuddha
post Jun 28 2019, 10:41 AM
Post#2


UtterAccess VIP
Posts: 11,528
Joined: 6-December 03
From: Telegraph Hill


Hi,

Look at these three lines of your code:
CODE
' ...
Bod_of_Mail = Range("C2").Value
' ...
.Body = Cells(i, 3).Value
.HTMLBody = Bod_of_Mail & "<br>" & strSignature & "<br>"
' ...


What is the contents of Range("C2").Value ?

I don't think you want .Body at all - just .HTMLBody

It looks like the body text is in Column C, so try:
CODE
' ...
Bod_of_Mail = Range("C2").Value
' ...
.HTMLBody = Cells(i, 3).Value & Bod_of_Mail & "<br>" & strSignature & "<br>"
' ...


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
arun.ms0910
post Jun 28 2019, 10:52 AM
Post#3



Posts: 19
Joined: 19-June 19



Its not not working properly

i have upload the image,i need 2nd image format
This post has been edited by arun.ms0910: Jun 28 2019, 10:53 AM
Attached File(s)
Attached File  Capture3.JPG ( 43.97K )Number of downloads: 4
Attached File  I_Want_this_format.JPG ( 30.86K )Number of downloads: 2
 
Go to the top of the page
 
cheekybuddha
post Jun 28 2019, 11:44 AM
Post#4


UtterAccess VIP
Posts: 11,528
Joined: 6-December 03
From: Telegraph Hill


Try this:
CODE
' ...
.HTMLBody = Replace(Cells(i, 3).Value, vbLf, "<br>") & Bod_of_Mail & "<br>" & strSignature & "<br>"
' ...


hth,

d

--------------------


Regards,

David Marten
Go to the top of the page
 
arun.ms0910
post Jun 28 2019, 11:57 AM
Post#5



Posts: 19
Joined: 19-June 19



Its Working...............Thanks lot frnd........... woohoo.gif
Go to the top of the page
 
arun.ms0910
post Jun 28 2019, 12:07 PM
Post#6



Posts: 19
Joined: 19-June 19



Hi ji i a have one more for that mail format please help me URL Links are show as paste special value

how to show hyperlink mode...

Thanks again....
Attached File(s)
Attached File  URL.JPG ( 25.39K )Number of downloads: 1
 
Go to the top of the page
 
cheekybuddha
post Jun 28 2019, 01:05 PM
Post#7


UtterAccess VIP
Posts: 11,528
Joined: 6-December 03
From: Telegraph Hill


Where are those links/texts coming from? A cell in the spreadsheet?

--------------------


Regards,

David Marten
Go to the top of the page
 
arun.ms0910
post Jun 28 2019, 08:23 PM
Post#8



Posts: 19
Joined: 19-June 19



Yes ji its taken from same cell
Go to the top of the page
 
arun.ms0910
post Jun 30 2019, 01:07 AM
Post#9



Posts: 19
Joined: 19-June 19



Any body is there
Go to the top of the page
 
cheekybuddha
post Jun 30 2019, 04:17 AM
Post#10


UtterAccess VIP
Posts: 11,528
Joined: 6-December 03
From: Telegraph Hill


Hi,

This is a bit more complicated. Can you post an example of one or two complete cells in Column C. Your images only ever show a small piece of the picture!

Please copy and paste the text, rather than post a screenshot.

You will need to create a function that:
1. Identifies the URL's in the text. This will be easier if the URL's are like in your picture, each beginning with http[s]:// and one per line. If so, the Split() function would be a good starting point, using vbLf (Chr(10)) as the delimiter to split on.
2. Determine whether each URL has some associated display text (I guess this is the stuff in parentheses) - if not, then what do you want to display?
3. Replace the URL's with HTML link text like: <a target='blank' href='https://portal.......'>Credit Application</a>

--------------------


Regards,

David Marten
Go to the top of the page
 
arun.ms0910
post Jul 2 2019, 11:07 AM
Post#11



Posts: 19
Joined: 19-June 19



K Sir Thank you..
Go to the top of the page
 
cheekybuddha
post Jul 2 2019, 11:18 AM
Post#12


UtterAccess VIP
Posts: 11,528
Joined: 6-December 03
From: Telegraph Hill


If you post the text you have in the cell then we can help you if you need.

--------------------


Regards,

David Marten
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    19th October 2019 - 02:30 AM