code tidy (part 2)

GaryPanic

Smoke me a Kipper,Skipper
Local time
Yesterday, 16:09
Joined
Nov 8, 2005
Messages
3,309
first of all - big thanks to Bob and VB who trimed my messy coding into something more manageable
below is the code so far (works a dream at work - slightly cocked up at home )
Now I like this little beast so I thought I would add a few more sections to it
like a heading on each paragrapgh (BoldP1) BoldP2.....
so 3 pargrapghs and 3 headings -- end effect - I is liking a LOT.. so I thinks to my self I'll add a few more (8 in total )
then code bitches at me too many lines ? - any way around this little problem
are there any little Access elfs out there who could wave their magic wand or use their mojo and point this sado in the right direction
I have renamed the par fields to Par4txt, Par5txt etc and i will rename the orginals ls to Par1txt ,




Private Sub EmailerZ_Click()

Dim frm As Form

Const bq As String = "<blockquote>"
Const bqe As String = "</blockquote>"

Dim EmailApp As Object, NameSpace As Object, EmailSend As Object


Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

Set frm = Forms!quotefrm


With frm

EmailSend.To = !



EmailSend.Subject = " Our Reference :-" & " " & ![Quoteno] & " - " & "(" & ![Insured] & ")"



EmailSend.HTMLBody = _
"<p>" & "For the Attention of :-" & ![POC] & " </p>" _
& vbCrLf & vbCrLf _
& "Insured :-" & ![Insured] & " </br>" _
& "Event :-" & ![Eventname] & " </br>" _
& "Dates :-" & ![openfrom] & " To " & ![opento] & " </br>" _
& "Venue :-" & ![venuename] & " </br>" _
& "<h1>" & ![Text184] & "</h1>" _
& bq & bq & "<b>" & ![BoldP1] & "</B>" & bqe & bqe _
& bq & bq & ![Text151] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP2] & "</B>" & bqe & bqe _
& bq & bq & ![Text155] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP3] & "</B>" & bqe & bqe _
& bq & bq & ![Text157] & bqe & bqe _
& vbCrLf & vbCrLf _
& ![AccounthandName] & "</br>" _
& ![Accounthandtitle] & "</br>" _
& ![AccEmail] & "</br>" _
& ![accTel] & "</br>" _
& ![AccFax] & "</br>" _
& "<p>" & ![Webaddz] & " </p>" _
& "<br/>" _
& "<p>" & ![AccountHandsignoff1] & "</p>" _
& "<p>" & ![accountHandsignoff2] & "</p>" _
& "<font size=""2"">" & ![accountHandsignoff8] & "</font>"







End With
 
Remember what I said about vbCrLf? It has no effect!

Remember what I mentioned about br? It's <br /> or <br> and not </br>

You need to write html or xhtml tags properly unless you will have browser incompatibility.

Could you please enclose your code in Code tags (again). I need to see the indenting in place.

What is the output like at the moment and what would you like it to be?
 
here we are this does what I want it to , one other thing on the wish list is the ability to change the font for the whole body of the email ? (but not vital)

Dim frm As Form

Const bq As String = "<blockquote>"
Const bqe As String = "</blockquote>"

Dim EmailApp As Object, NameSpace As Object, EmailSend As Object


Set EmailApp = CreateObject("Outlook.Application")
Set NameSpace = EmailApp.GetNamespace("MAPI")
Set EmailSend = EmailApp.CreateItem(0)

Set frm = Forms!quotefrm


With frm

EmailSend.to = !



EmailSend.Subject = " Our Reference :-" & " " & ![QuoteNo] & " - " & "(" & ![Insured] & ")"



EmailSend.HTMLBody = _
"<p>" & "For the Attention of :-" & ![POC] & " </p>" _
& "Insured :-" & ![Insured] & bqe & "Event :-" & ![Eventname] & bqe _
& "Dates :-" & ![openfrom] & " To " & ![opento] & bqe & "Venue :-" & ![venuename] & bqe _
& "<h1>" & ![Text184] & "</h1>" _
& bq & bq & "<b>" & ![BoldP1] & "</b>" & bqe & bqe & bq & bq & ![Text151] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP2] & "</b>" & bqe & bqe & bq & bq & ![Text155] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP3] & "</b>" & bqe & bqe & bq & bq & ![Text157] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP4] & "</b>" & bqe & bqe & bq & bq & ![TextPar4] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP5] & "</b>" & bqe & bqe & bq & bq & ![TextPar5] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP6] & "</b>" & bqe & bqe & bq & bq & ![TextPar6] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP7] & "</b>" & bqe & bqe & bq & bq & ![TextPar7] & bqe & bqe _
& bq & bq & "<b>" & ![BoldP8] & "</b>" & bqe & bqe & bq & bq & ![TextPar8] & bqe & bqe _
& "<p>" & ![AccounthandName] & " </p>" & bqe & ![Accounthandtitle] & bqe & ![AccEmail] & bqe & ![accTel] & bqe & ![AccFax] & bqe _
& "<p>" & ![Webaddz] & " </p>" & bqe & bqe _
& "<p>" & ![AccountHandsignoff1] & "</p>" _
& "<p>" & ![accountHandsignoff2] & "</p>" _
& "<font size=""2"">" & ![accountHandsignoff8] & "</font>"







End With
 
resolved

all hunky dorey

I used <br> to get a return carrage - tried it on two different op systems identical results

Gary is in happy land

I will return but not on this subject

(I also had to use everything I learnt on this project for a quick result on checking and confirming data is correct and used the above to automate my responses ) - So big up to Bob and even bigger one for VB - your a star
gp
 

Users who are viewing this thread

Back
Top Bottom