Paste signature automatically into outlook htmlbody - polish signs (unicode with utf-8 encoding)

jaryszek

Board Regular
Joined
Jul 1, 2016
Messages
213
Hi People,

I have the macro in Access which is sending e-mails for each record within query:

Code:
   Set olApp = CreateObject("Outlook.application")
   Set olItem = olApp.CreateItem(0)

   vitems = Slownik.items
   vkeys = Slownik.Keys
                    
   SpolkaString = Split(Slownik(vkeys(Slownik.Count - 1)), Chr(2))(1)
   EmailString = Split(Slownik(vkeys(Slownik.Count - 1)), Chr(2))(0)
                
    olItem.To = EmailString
    olItem.Subject = "Braki kadrowe"
    olItem.htmlbody = "Dzień dobry, " & "
" & "
" & "przesyłam wykaz brakujących dokumentów kadrowych ze spółki " & _
    SpolkaString & " Proszę o uzupełnienie. 

" & _
    Join(aBody, vbNewLine) & "

" & [B]signature[/B]
        
    olItem.Display
    Set olItem = Nothing

It is everything ok but Signature is individual for each user which will be sending e-mails.

I have found the code which is creating signature from Microsoft templates of user's signature:

'
Code:
DECLARE AND SET VARIABLES
    Dim myOutlok As Object
    Dim myMailItm As Object
    Dim Signature As String
    Shell ("OUTLOOK")
    Set otlApp = CreateObject("Outlook.Application")
    Set OtlNewMail = otlApp.CreateItem(olMailItem)
'-----------------------------------------
'GET DEFAULT EMAIL SIGNATURE
    Signature = Environ("appdata") & "\Microsoft\Signatures\"
    If Dir(Signature, vbDirectory) <> vbNullString Then
        Signature = Signature & Dir$(Signature & "*.htm")
    Else:
        Signature = ""
    End If
    Signature = CreateObject("Scripting.FileSystemObject").GetFile(Signature).OpenAsTextStream(1, -2).ReadAll

Now my html code within signature looks like in attachment.

-->

Using this code all is working fine, my signature is great but it is without polish characters

Why does the problem occur?

Best Wishes,
Jacek Antek<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:238;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-536870145 1073786111 1 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
a:link, span.MsoHyperlink
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
mso-themecolor:followedhyperlink;
text-decoration:underline;
text-underline:single;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:11.0pt;
mso-ansi-font-size:11.0pt;
mso-bidi-font-size:11.0pt;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;} @Page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.WordSection1
{page:WordSection1;}
-->
</style>

<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:238;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-536870145 1073786111 1 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
a:link, span.MsoHyperlink
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
mso-themecolor:followedhyperlink;
text-decoration:underline;
text-underline:single;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:11.0pt;
mso-ansi-font-size:11.0pt;
mso-bidi-font-size:11.0pt;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;} @Page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.WordSection1
{page:WordSection1;}
-->
</style><style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:238;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-536870145 1073786111 1 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
a:link, span.MsoHyperlink
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
mso-themecolor:followedhyperlink;
text-decoration:underline;
text-underline:single;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:11.0pt;
mso-ansi-font-size:11.0pt;
mso-bidi-font-size:11.0pt;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;} @Page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.WordSection1
{page:WordSection1;}
-->
</style>
 
Last edited:

Excel Facts

Who is Mr Spreadsheet?
Author John Walkenbach was Mr Spreadsheet until his retirement in June 2019.
</xml><![endif]-->
<style>
<!--
/* Font Definitions */
@font-face
{font-family:Calibri;
panose-1:2 15 5 2 2 2 4 3 2 4;
mso-font-charset:238;
mso-generic-font-family:swiss;
mso-font-pitch:variable;
mso-font-signature:-536870145 1073786111 1 0 415 0;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{mso-style-unhide:no;
mso-style-qformat:yes;
mso-style-parent:"";
margin:0cm;
margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;}
a:link, span.MsoHyperlink
{mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
color:blue;
text-decoration:underline;
text-underline:single;}
a:visited, span.MsoHyperlinkFollowed
{mso-style-noshow:yes;
mso-style-priority:99;
color:purple;
mso-themecolor:followedhyperlink;
text-decoration:underline;
text-underline:single;}
.MsoChpDefault
{mso-style-type:export-only;
mso-default-props:yes;
font-size:11.0pt;
mso-ansi-font-size:11.0pt;
mso-bidi-font-size:11.0pt;
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-fareast-font-family:"Times New Roman";
mso-fareast-theme-font:minor-fareast;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;
mso-bidi-font-family:"Times New Roman";
mso-bidi-theme-font:minor-bidi;} @Page WordSection1
{size:612.0pt 792.0pt;
margin:70.85pt 70.85pt 70.85pt 70.85pt;
mso-header-margin:35.4pt;
mso-footer-margin:35.4pt;
mso-paper-source:0;}
div.WordSection1
{page:WordSection1;}
-->
</style>
<!--[if gte mso 10]>
<style>
/* Style Definitions */
table.MsoNormalTable
{mso-style-name:Standardowy;
mso-tstyle-rowband-size:0;
mso-tstyle-colband-size:0;
mso-style-noshow:yes;
mso-style-priority:99;
mso-style-parent:"";
mso-padding-alt:0cm 5.4pt 0cm 5.4pt;
mso-para-margin:0cm;
mso-para-margin-bottom:.0001pt;
mso-pagination:widow-orphan;
font-size:11.0pt;
font-family:"Calibri","sans-serif";
mso-ascii-font-family:Calibri;
mso-ascii-theme-font:minor-latin;
mso-hansi-font-family:Calibri;
mso-hansi-theme-font:minor-latin;}
</style>
<![endif]-->
</head>

****** lang=PL link=blue vlink=purple style='tab-interval:35.4pt'>

<div class=WordSection1>

<p class=MsoNormal><span style='font-size:10.0pt;mso-bidi-font-size:11.0pt;
mso-ascii-font-family:Calibri;mso-hansi-font-family:Calibri'><o:p> </o:p></span></p>

<p class=MsoNormal><a name="_MailAutoSig"><span style='font-size:10.0pt;
color:black;mso-no-proof:yes'>Z Wyrazami Szacunku,<o:p></o:p></span></a></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><b><span
style='font-size:10.0pt;color:black;mso-no-proof:yes'>�ukasz Jarych<o:p></o:p></span></b></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:10.0pt;color:black;mso-no-proof:yes'>Analityk Biznesowy<o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span lang=EN-US
style='font-size:10.0pt;color:black;mso-ansi-language:EN-US;mso-no-proof:yes'>tel.:
+48 510 014 502</span></span><span style='mso-bookmark:_MailAutoSig'><span
lang=EN-US style='font-size:4.0pt;color:black;mso-ansi-language:EN-US;
mso-no-proof:yes'><o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:10.0pt;mso-bidi-font-size:11.0pt;mso-ascii-font-family:Calibri;
mso-hansi-font-family:Calibri;mso-no-proof:yes'><!--[if gte vml 1]><v:shapetype
id="_x0000_t75" coordsize="21600,21600" o:spt="75" o:preferrelative="t"
path="m@4@5l@4@11@9@11@9@5xe" filled="f" stroked="f">
<v:stroke joinstyle="miter"/>
<v:formulas>
<v:f eqn="if lineDrawn pixelLineWidth 0"/>
<v:f eqn="sum @0 1 0"/>
<v:f eqn="sum 0 0 @1"/>
<v:f eqn="prod @2 1 2"/>
<v:f eqn="prod @3 21600 pixelWidth"/>
<v:f eqn="prod @3 21600 pixelHeight"/>
<v:f eqn="sum @0 0 1"/>
<v:f eqn="prod @6 1 2"/>
<v:f eqn="prod @7 21600 pixelWidth"/>
<v:f eqn="sum @8 21600 0"/>
<v:f eqn="prod @7 21600 pixelHeight"/>
<v:f eqn="sum @10 21600 0"/>
</v:formulas>
<v:path o:extrusionok="f" gradientshapeok="t" o:connecttype="rect"/>
<o:lock v:ext="edit" aspectratio="t"/>
</v:shapetype><v:shape id="Obraz_x0020_4" o:spid="_x0000_i1025" type="#_x0000_t75"
style='width:95.25pt;height:29.25pt;visibility:visible;mso-wrap-style:square'>
<v:imagedata src="E4B_pliki/image001.jpg" o:title="" croptop="5413f"
cropbottom="5997f" cropleft="1516f" cropright="1516f"/>
</v:shape><![endif]--><![if !vml]><img width=127 height=39
src="E4B_pliki/image002.jpg" v:shapes="Obraz_x0020_4"><![endif]></span></span><span
style='mso-bookmark:_MailAutoSig'><span lang=EN-US style='font-size:2.0pt;
color:#1F497D;mso-ansi-language:EN-US;mso-no-proof:yes'><o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span lang=EN-US
style='font-size:2.0pt;color:#1F497D;mso-ansi-language:EN-US;mso-no-proof:yes'><o:p> </o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><b><span lang=EN-US
style='font-size:8.0pt;color:#7F7F7F;mso-ansi-language:EN-US;mso-no-proof:yes'>Experts
for Business  Sp. z o.o.<o:p></o:p></span></b></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:8.0pt;color:#7F7F7F;mso-no-proof:yes'>ul. Antoniego
SĹ‚onimskiego 6, 50-304 WrocĹ‚aw  <o:p></o:p></span></span></p>

<p class=MsoNormal style='line-height:115%'><span style='mso-bookmark:_MailAutoSig'></span><a
href="mailto:biuro@experts4business.pl"><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:8.0pt;line-height:115%;color:#7F7F7F;mso-no-proof:yes'>biuro@experts4business.pl</span></span><span
style='mso-bookmark:_MailAutoSig'></span></a><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:2.0pt;line-height:115%;color:#7F7F7F;mso-no-proof:yes'> </span></span><span
style='mso-bookmark:_MailAutoSig'><span style='font-size:8.0pt;line-height:
115%;color:#7F7F7F;mso-no-proof:yes'><o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:8.0pt;color:#7F7F7F;mso-no-proof:yes'>Kapitał zakładowy 275
000 zł, Sąd Rejonowy dla Wrocławia-Fabrycznej, VI Wydział Gospodarczy <br>
KRS 0000339728, REGON 021094565, NIP 8942986324<o:p></o:p></span></span></p>

<p class=MsoNormal style='line-height:150%'><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:8.0pt;line-height:150%;color:#7F7F7F;mso-no-proof:yes'>____________________________________________________________________________________<o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span
style='font-size:8.0pt;color:#7F7F7F;mso-no-proof:yes'>Wiadomość ta oraz
wszelkie załączone do niej pliki są poufne i mogą być prawnie chronione. Jeżeli
nie jest Pan/Pani zamierzonym adresatem niniejszej wiadomości, nie może
Pan/Pani jej ujawniać, kopiować, rozpowszechniać, ani też w żaden inny sposób
udostępniać lub wykorzystywać. O błędnym zaadresowaniu wiadomości prosimy
niezwłocznie poinformować nadawcę i usunąć wiadomość. <o:p></o:p></span></span></p>

<p class=MsoNormal><span style='mso-bookmark:_MailAutoSig'><span lang=EN-US
style='font-size:8.0pt;color:#7F7F7F;mso-ansi-language:EN-US;mso-no-proof:yes'>This
email and any attached files are confidential and may be legally privileged. If
you are not the intended recipient, any disclosure, reproduction, copying,
distribution, or other dissemination or use of this communication is strictly
prohibited. If you have received this transmission in error please notify the
sender immediately and then delete this email.<o:p></o:p></span></span></p>

<span style='mso-bookmark:_MailAutoSig'></span>

<p class=MsoNormal><span lang=EN-US style='mso-ansi-language:EN-US'><o:p> </o:p></span></p>

<p class=MsoNormal><o:p> </o:p></p>

</div>

</body>

</html>
 
Upvote 0

Forum statistics

Threads
1,214,823
Messages
6,121,779
Members
449,049
Latest member
greyangel23

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top