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
> Outlook 2016 Body Line Alignment, Access 2016    
 
   
johan
post Jan 17 2020, 06:02 AM
Post#1



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


My Windows 7 updated last night and now my lines in the body of the email is centered, it was perfect before this update, please attachement pdf, below is the code
CODE
Private Sub AmendmentInsurer_Click()
    Dim stDocName       As String
    Dim MyPath          As String
    Dim MyFileName      As String
    Dim Variable_To     As String
    Dim Variable_CC     As String
    Dim Variable_Subject As String
    Dim Variable_Body   As String
    Dim Signature       As String
    Dim OutApp          As Object
    Dim OutMail         As Object
    Dim OutlookAttach   As Outlook.Attachment
    Dim strFileName     As String

    'Call Client confirmation
    '------------------------
    Call AmendConfir_Click

    ' The filepath for the attachment
    '--------------------------------
    If Not IsNull(Me.strHyperlink) Then
    strFileName = Mid$(Me.strHyperlink, InStr(Me.strHyperlink, "#") + 1)
    Else
    strFileName = "Empty"
    End If

    'Set Variables
    '---------------------------
    Variable_To = ""
    Variable_CC = Me.Text97
    Variable_Subject = Me.Text32 & "/" & Me.Text36 & " " & Me.Text35 & " " & Me.Text34 & " - Service#: " & Amendment_nr
    Variable_Body = "<FONT face=Verdana size=2><B>CLIENT: </B>" & Me.Text82 & " " & Me.Text35 & " " & Me.Text34 & "<BR>"
    Variable_Body = Variable_Body & "<B>INSURER: </B>" & Me.Text41 & "<BR>"
    Variable_Body = Variable_Body & "<B>POLICY#: </B>" & Me.Text32 & "<BR>"
    Variable_Body = Variable_Body & "<B>SERVICE#:</B> <font color=red>" & Me.Amendment_nr & "</font><BR>"
    Variable_Body = Variable_Body & "<B>AMENDMENT DATE:</B> " & Me.AmendDate & "<BR>"
    Variable_Body = Variable_Body & "Please <B>AMEND</B> policy as follow and <B><U>POST</U></B> schedule "
    Variable_Body = Variable_Body & "to my client and a copy to my office."
    Variable_Body = Variable_Body & "<hr style= 'color:Red;height:1pt' />"
    Variable_Body = Variable_Body & Me.Amendment
    Variable_Body = Variable_Body & "<hr style= 'color:Red;height:1pt' />"
    Variable_Body = Variable_Body & "Groete/Regards<BR>"
                      
    'Set the ATTACHMENT field
    '--------------------------------------------------------------------------------------
    'If Not IsNull(strHyperlink) Then
    'OutlookMail.Attachments.Add (strFileName)
    'End If

    'Set Outlook session with signature
    '-----------------------------------------------
    Set OutApp = CreateObject("Outlook.Application")
    OutApp.Session.Logon
    Set OutMail = OutApp.CreateItem(0)
    On Error Resume Next
    With OutMail                               ' This creates a blank email and captures the users default signature.
        .BodyFormat = 2                        ' 2 = HTML format
        .Display
    End With

    Signature = OutMail.HTMLBody

    With OutMail

        .To = Variable_To
        .CC = Variable_CC
        .BCC = ""
        .Subject = Variable_Subject
        .Attachments.Add (strFileName)
        .HTMLBody = Variable_Body & Signature
        .Display                               'or use .Send
        .ReadReceiptRequested = True
    End With
    MsgBox "The Email has been send successfully to" & " " & Me.To
End Sub

Attached File(s)
Attached File  Doc1.pdf ( 108.9K )Number of downloads: 10
 

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
cheekybuddha
post Jan 17 2020, 07:32 AM
Post#2


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


I'm not sure of the cause.

You can probably hack around it by using something like:
CODE
' ...
    Variable_Body = Variable_Body & "Groete/Regards<BR>"

    Variable_Body = "<div align='left'>" & Variable_Body & "</div>"
' ...


hth,

d

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


Regards,

David Marten
Go to the top of the page
 
DanielPineault
post Jan 17 2020, 08:29 AM
Post#3


UtterAccess VIP
Posts: 7,144
Joined: 30-June 11



wouldn't that be 'text-align' rather than 'align' in the style (div align support was dropped as of HTML5 although it may still work in Outlook)?
CODE
<div style="text-align:left;">Your Content</div>

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
cheekybuddha
post Jan 17 2020, 08:29 AM
Post#4


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


I was suggesting to use the old align attribute rather than CSS since email html is so stuck in the dark ages!

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


Regards,

David Marten
Go to the top of the page
 
DanielPineault
post Jan 17 2020, 08:31 AM
Post#5


UtterAccess VIP
Posts: 7,144
Joined: 30-June 11



With Outlook, yes, you may be right, older code may be better.

Sorry.

--------------------
Daniel Pineault (2010-2019 Microsoft MVP, UA VIP, EE Distinguished Expert 2018)
Professional Help: https://www.cardaconsultants.com
Free MS Access Code, Tips, Tricks and Samples: https://www.devhut.net

* Design should never say "Look at me". It should always say "Look at this". -- David Craib
* A user interface is like a joke, if you have to explain it, it's not that good! -- Martin LeBlanc


All code samples, demonstration databases, links,... are provided 'AS IS' and are to be used at your own risk! Take the necessary steps to check, validate ...(you are responsible for your choices and actions)
Go to the top of the page
 
cheekybuddha
post Jan 17 2020, 08:33 AM
Post#6


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


To be fair, it will probably handle such simple CSS.

But of late, I have opted to stop fighting the fact that email html is better served by using old things like nested tables for alignment etc rather than CSS.

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


Regards,

David Marten
Go to the top of the page
 
johan
post Jan 22 2020, 03:23 AM
Post#7



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


Apologies for the reply. As you can see the red lines in the email body (see attachment in first post) is centered instead as from left to right, the code for the line insert is
CODE
Variable_Body = Variable_Body & "<hr style= 'color:Red;height:1pt' />"

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
cheekybuddha
post Jan 22 2020, 04:53 AM
Post#8


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


Ah, I see!

The red line is meant to underline the text!

What happens if you try:
CODE
' ...
    Variable_Body = Variable_Body & "<B>AMENDMENT DATE:</B> " & Me.AmendDate & "<BR>"
    Variable_Body = Variable_Body & "<span style='border-bottom: 1px solid red;'>Please <B>AMEND</B> policy as follow and <B><U>POST</U></B> schedule "
    Variable_Body = Variable_Body & "to my client and a copy to my office.</span>"
    Variable_Body = Variable_Body & Me.Amendment
' ...

?

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


Regards,

David Marten
Go to the top of the page
 
johan
post Jan 22 2020, 05:01 AM
Post#9



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


David line is like a divider between text

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
cheekybuddha
post Jan 22 2020, 05:05 AM
Post#10


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


OK,

Then revert to what you had originally, but change the <hr> line to:
CODE
' ...
    Variable_Body = Variable_Body & "<hr style= 'color:Red;height:1pt;width:100%;' />"
' ...


hth,

d

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


Regards,

David Marten
Go to the top of the page
 
johan
post Jan 22 2020, 05:18 AM
Post#11



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


David I tried the code but the lines are still centered, just a bit longer

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
johan
post Jan 22 2020, 06:56 AM
Post#12



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


David I find this, how to insert email seperator line, I am sure if one can automate that with Access

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
cheekybuddha
post Jan 22 2020, 08:34 AM
Post#13


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


Try inserting a line in a empty email according to the instructions you linked to in the SE thread.

Then view the email's HTML and post it here. Perhaps we can recreate it.

d

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


Regards,

David Marten
Go to the top of the page
 
johan
post Jan 23 2020, 07:58 AM
Post#14



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


David where do I find the email HTML
Attached File(s)
Attached File  Doc1.pdf ( 127.81K )Number of downloads: 3
 

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 
cheekybuddha
post Jan 23 2020, 08:02 AM
Post#15


UtterAccess Moderator
Posts: 12,345
Joined: 6-December 03
From: Telegraph Hill


Hi johan,

1. Create a new email normally in Outlook.

2. Add the line according to the instructions in your prior post

3. Send it to yourself

4. Open the email you receive.

5. Follow instructions here.

6. Copy and paste the HTML here (use code tags)

hth,

d

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


Regards,

David Marten
Go to the top of the page
 
johan
post Jan 23 2020, 08:15 AM
Post#16



Posts: 1,035
Joined: 24-April 08
From: Riebeek Kasteel, Western Cape, South Africa


David thanks see below
CODE
<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40"><head><meta http-equiv=Content-Type content="text/html; charset=iso-8859-1"><meta name=Generator content="Microsoft Word 15 (filtered medium)"><!--[if !mso]><style>v\:* {behavior:URL(#default#VML);}
o\:* {behavior:URL(#default#VML);}
w\:* {behavior:URL(#default#VML);}
.shape {behavior:URL(#default#VML);}
</style><![endif]--><style><!--
/* Font Definitions */
@font-face
    {font-family:"Cambria Math";
    panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
    {font-family:Calibri;
    panose-1:2 15 5 2 2 2 4 3 2 4;}
@font-face
    {font-family:Verdana;
    panose-1:2 11 6 4 3 5 4 4 2 4;}
@font-face
    {font-family:Vivaldi;
    panose-1:3 2 6 2 5 5 6 9 8 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
    {margin:0cm;
    margin-bottom:.0001pt;
    font-size:11.0pt;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
span.EmailStyle17
    {mso-style-type:personal-compose;
    font-family:"Verdana",sans-serif;
    color:windowtext;}
.MsoChpDefault
    {mso-style-type:export-only;
    font-family:"Calibri",sans-serif;
    mso-fareast-language:EN-US;}
@page WordSection1
    {size:612.0pt 792.0pt;
    margin:72.0pt 72.0pt 72.0pt 72.0pt;}
div.WordSection1
    {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]--></head><body lang=EN-ZA link="#0563C1" vlink="#954F72"><div class=WordSection1><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'>Dear Test<o:p></o:p></span></p><div style='mso-element:para-border-div;border-top:solid windowtext 1.0pt;border-left:none;border-bottom:solid windowtext 1.0pt;border-right:none;padding:1.0pt 0cm 1.0pt 0cm'><p class=MsoNormal style='border:none;padding:0cm'><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'>Test separator line<o:p></o:p></span></p></div><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'>Regards<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:20.0pt;font-family:Vivaldi;color:black;mso-fareast-language:EN-ZA'>JKotzé<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:10.0pt;font-family:"Verdana",sans-serif;color:black;mso-fareast-language:EN-ZA'>Johan Kotzé<o:p></o:p></span></p><p class=MsoNormal><b><span style='font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'><o:p>&nbsp;</o:p></span></b></p><p class=MsoNormal><span style='font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'><img width=454 height=107 style='width:4.7291in;height:1.1145in' id="Picture_x0020_1" src="cid:image001.png@01D5D1FD.E5E467E0" alt=Johan>&nbsp; </span><a href="http://www.jkbrokers.co.za/requestquote.php"><span style='font-family:"Verdana",sans-serif;color:blue;mso-fareast-language:EN-ZA;text-decoration:none'><img border=0 width=154 height=35 style='width:1.6041in;height:.3645in' id="Picture_x0020_2" src="cid:image002.png@01D5D1FD.E5E467E0" alt=stiQ></span></a><span style='color:#1F497D;mso-fareast-language:EN-ZA'>&nbsp;&nbsp;<img border=0 width=146 height=90 style='width:1.5208in;height:.9375in' id="Picture_x0020_3" src="cid:image003.gif@01D5D1FD.E5E467E0" alt="Think before you print"></span><span style='font-size:10.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'><o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'>&nbsp;&nbsp;Authorised Financial Services Provider (FSP#: 46740)<o:p></o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'><o:p>&nbsp;</o:p></span></p><p class=MsoNormal><span style='font-size:8.0pt;font-family:"Verdana",sans-serif;color:#1F497D;mso-fareast-language:EN-ZA'>For email disclaimer visit <a href="http://www.jkbrokers.co.za/emaildisclaimer.html"><span style='color:blue'>http://www.jkbrokers.co.za/emaildisclaimer.html</span></a><o:p></o:p></span></p><p class=MsoNormal><o:p>&nbsp;</o:p></p></div></body></html>

--------------------
Johan
Winners don't do different things, they do things different.
Go to the top of the page
 


Custom Search


RSSSearch   Top   Lo-Fi    25th February 2020 - 04:35 AM