Rabu, 31 Oktober 2018

[MS_AccessPros] is it possible to display the outlook signature in the mail body?

 

Dear All,

I have a function as following, which send emails and attachment, My question is: is it possible to display the outlook signature in the mail body? Thanks in advance.

'code start

Sub SendReportHTML(strReportName As String, strEmail As String, strSubject As String, strFilePath As String, strFilePathPdf As String, strSendOrDisplay, Optional strAttachmentReportName As String = "")
Dim strHTML As String, strInput As String
Dim strEmailAddress As String

Const olMailItem = 0
Const olFormatHTML = 2
Dim objOlApp As Object, objOlMail As Object

Dim myAttachments As Object ' Outlook.Attachments

' If last parameter supplied,
If strAttachmentReportName <> "" Then
' Output the PDF
DoCmd.OutputTo acOutputReport, strAttachmentReportName, acFormatPDF, strFilePathPdf
End If

' Output the 1-page report to html
DoCmd.OutputTo acOutputReport, strReportName, acFormatHTML, strFilePath
' Open the resulting file
Open strFilePath For Input As #1
' Create an Outlook session
Set objOlApp = CreateObject("Outlook.Application")
' Start a new email
Set objOlMail = objOlApp.CreateItem(olMailItem)
' Read in the created HTML and put together an output string
Do While Not EOF(1) ' Loop until end of file
' Get a line from the file
Input #1, strInput
' Add it to the accumulated HTML
strHTML = strHTML & strInput
Loop
' Close the file
Close #1
' Replace lines
strHTML = Replace(strHTML, "*^*", "<hr>")

' Use the mail item for several tasks
With objOlMail
' Set the recipient
.To = strEmail
' Set the subject
.Subject = strSubject
' Tell Outlook email is in HTML format
.BodyFormat = olFormatHTML
' Add the HTML message
.HTMLBody = strHTML & vbCrLf & .HTMLBody
' Skip if no PDF specified
If strAttachmentReportName <> "" Then
' Point to the attachments of the message
Set myAttachments = .Attachments
' Add the attached file
myAttachments.Add strFilePathPdf
End If

' Send the email or Display
If strSendOrDisplay = "Send" Then
.Send
Else
.Display
End If

End With

' Clear the objects
Set objOlMail = Nothing
Set objOlApp = Nothing
' Skip errors past this point
On Error Resume Next
' Delete the two files
Kill strFilePath
Kill strFilePathPdf
End Sub

Best Regards,
Kevin

Zhao LiQing

__._,_.___

Posted by: <zhao.liqing@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (1)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

[AccessDevelopers] File - Monthly_Notices.txt

 


Monthly notices:

Hi Kids!:

Don't forget to check out our "Links" section at the website for helpful sites. Also take a peek at books that others have found worthwhile in our books database under the 'Database' link of the main AccessDevelopers page. Feel free to add any books or links that you have found useful.

__._,_.___
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (172)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


Please zip all files prior to uploading to Files section.

SPONSORED LINKS
.

__,_._,___

Minggu, 28 Oktober 2018

Re: [MS_AccessPros] query when there are record that differ for capital letter

 

you're welcome, Valentino  ~ happy to help

On 10/28/2018 1:30 PM, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] wrote:

Crystal,

thank you very much

It works perfectly!

 

Valentino



Il giorno dom 28 ott 2018 alle ore 07:51 crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> ha scritto:
 

the full SQL would be:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01, aptbstr02
WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0
 
~crystal


On 10/27/2018 5:30 PM, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] wrote:
you're welcome,

instead of linking with a join line, you could match records using criteria. For example:

WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0

respectfully,
crystal

Unicode Character Map -- free tool in Access
http://msaccessgurus.com/tool/UnicodeCharMap.htm

On 10/27/2018 1:55 PM, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] wrote:

Thank you Crystal, 

my problema is that I need to link some table using this field and I have non clear how I can do the inner join between the two tables, it is possible have an example how have the query below but case sensitive? 


SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code



Valentino 

Il giorno 27 ott 2018, alle ore 16:44, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> ha scritto:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code;

 

I get a result of 4 record because for




__._,_.___

Posted by: crystal 8 <strive4peace2008@yahoo.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (8)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

Re: [MS_AccessPros] query when there are record that differ for capital letter

 

Crystal,

thank you very much

It works perfectly!

 

Valentino



Il giorno dom 28 ott 2018 alle ore 07:51 crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> ha scritto:
 

the full SQL would be:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01, aptbstr02
WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0
 
~crystal


On 10/27/2018 5:30 PM, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] wrote:
you're welcome,

instead of linking with a join line, you could match records using criteria. For example:

WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0

respectfully,
crystal

Unicode Character Map -- free tool in Access
http://msaccessgurus.com/tool/UnicodeCharMap.htm

On 10/27/2018 1:55 PM, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] wrote:

Thank you Crystal, 

my problema is that I need to link some table using this field and I have non clear how I can do the inner join between the two tables, it is possible have an example how have the query below but case sensitive? 


SELECT aptbstr01..code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code



Valentino 

Il giorno 27 ott 2018, alle ore 16:44, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> ha scritto:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code;

 

I get a result of 4 record because for



__._,_.___

Posted by: Valentino Avvisati <valentino.avvisati@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (7)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___

R: [MS_AccessPros] query when there are record that differ for capital letter

 

Crystal,

thank you very much

It works perfectly!

 

Valentino

 

Da: MS_Access_Professionals@yahoogroups.com [mailto:MS_Access_Professionals@yahoogroups.com]
Inviato: domenica 28 ottobre 2018 07:32
A: MS_Access_Professionals@yahoogroups.com
Oggetto: Re: [MS_AccessPros] query when there are record that differ for capital letter

 

 

the full SQL would be:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01, aptbstr02
WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0
 
~crystal

On 10/27/2018 5:30 PM, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] wrote:

you're welcome,

instead of linking with a join line, you could match records using criteria. For example:

WHERE StrComp(aptbstr01.code, aptbstr02.code, 0) = 0

respectfully,
crystal

Unicode Character Map -- free tool in Access
http://msaccessgurus.com/tool/UnicodeCharMap.htm

On 10/27/2018 1:55 PM, Valentino Avvisati valentino.avvisati@gmail.com [MS_Access_Professionals] wrote:

Thank you Crystal, 

my problema is that I need to link some table using this field and I have non clear how I can do the inner join between the two tables, it is possible have an example how have the query below but case sensitive? 

 

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code

 

 

Valentino 


Il giorno 27 ott 2018, alle ore 16:44, crystal 8 strive4peace2008@yahoo.com [MS_Access_Professionals] <MS_Access_Professionals@yahoogroups.com> ha scritto:

SELECT aptbstr01.code, aptbstr02.code

FROM aptbstr01 INNER JOIN aptbstr02 ON aptbstr01.code = aptbstr02.code;

 

I get a result of 4 record because for

 

 

__._,_.___

Posted by: "Gmail" <valentino.avvisati@gmail.com>
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (6)

Have you tried the highest rated email app?
With 4.5 stars in iTunes, the Yahoo Mail app is the highest rated email app on the market. What are you waiting for? Now you can access all your inboxes (Gmail, Outlook, AOL and more) in one place. Never delete an email again with 1000GB of free cloud storage.


SPONSORED LINKS
.

__,_._,___