PC Review
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Sending a Right to Left email from Access
Forums
Newsgroups
Microsoft Outlook
Microsoft Outlook VBA Programming
Sending a Right to Left email from Access
![]() |
Sending a Right to Left email from Access |
|
|
Thread Tools | Rate Thread |
|
|
#1 |
|
Guest
Posts: n/a
|
Hi
I'm trying to send a Right to Left Email from access. I'm trying to find a way for the text to be aligned to the right and to be written from the Right to the Left. I'm not using the DoCmd.SendObject , , , , , , strSubject, strMsg code as I can't find a way pass the RTL ref into it. I'm trying to use the Outlook VBA to do this but I can't find the way to do this. This is my current code: ' Vars Dim strMsg As String Dim strSubject Dim olApp As New Outlook.Application Dim olNameSpace As Outlook.NameSpace Dim olMail As Outlook.MailItem ' Open an Outlook object Set olNameSpace = olApp.GetNamespace("MAPI") Set olMail = olApp.CreateItem(olMailItem) ' Message text strMsg = "The message text" strSubject = "Subject Line text" ' Open message With olMail .Subject = strSubject .BodyFormat = olFormatRichText .Body = strMsg .Display End With thanks for your help Gal |
|
|
|
#2 |
|
Guest
Posts: n/a
|
Instead of setting the Body property, set the HTMLBody to a formatted HTML
text. You can also try to set the MailItem.InternetCodepage property to an appropriate code page. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... > Hi > I'm trying to send a Right to Left Email from access. > I'm trying to find a way for the text to be aligned to the right and to be > written from the Right to the Left. > I'm not using the > DoCmd.SendObject , , , , , , strSubject, strMsg > code as I can't find a way pass the RTL ref into it. > I'm trying to use the Outlook VBA to do this but I can't find the way to > do this. > This is my current code: > > ' Vars > Dim strMsg As String > Dim strSubject > Dim olApp As New Outlook.Application > Dim olNameSpace As Outlook.NameSpace > Dim olMail As Outlook.MailItem > ' Open an Outlook object > Set olNameSpace = olApp.GetNamespace("MAPI") > Set olMail = olApp.CreateItem(olMailItem) > ' Message text > strMsg = "The message text" > strSubject = "Subject Line text" > ' Open message > With olMail > .Subject = strSubject > .BodyFormat = olFormatRichText > .Body = strMsg > .Display > End With > > thanks for your help > > Gal > |
|
|
|
#3 |
|
Guest
Posts: n/a
|
So did you try to set the HTMLBody property to an HTML string that specifies
the right alignment? <p align="right">...</p> Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message news:OTQyz3DiFHA.3316@TK2MSFTNGP14.phx.gbl... > Hi Dmitry > unfortunately this doesn't do the trick, the text is still displayed from > left to right. > What I'm looking for is the ability to change the paragraph format, as in > the menu: > Format - Paragraph - Direction - Right to left > > The codepage I'm using is 1255 btw. > > Gal > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message > news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... >> Instead of setting the Body property, set the HTMLBody to a formatted >> HTML text. >> You can also try to set the MailItem.InternetCodepage property to an >> appropriate code page. >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >> news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >>> Hi >>> I'm trying to send a Right to Left Email from access. >>> I'm trying to find a way for the text to be aligned to the right and to >>> be written from the Right to the Left. >>> I'm not using the >>> DoCmd.SendObject , , , , , , strSubject, strMsg >>> code as I can't find a way pass the RTL ref into it. >>> I'm trying to use the Outlook VBA to do this but I can't find the way to >>> do this. >>> This is my current code: >>> >>> ' Vars >>> Dim strMsg As String >>> Dim strSubject >>> Dim olApp As New Outlook.Application >>> Dim olNameSpace As Outlook.NameSpace >>> Dim olMail As Outlook.MailItem >>> ' Open an Outlook object >>> Set olNameSpace = olApp.GetNamespace("MAPI") >>> Set olMail = olApp.CreateItem(olMailItem) >>> ' Message text >>> strMsg = "The message text" >>> strSubject = "Subject Line text" >>> ' Open message >>> With olMail >>> .Subject = strSubject >>> .BodyFormat = olFormatRichText >>> .Body = strMsg >>> .Display >>> End With >>> >>> thanks for your help >>> >>> Gal >>> >> >> > > |
|
|
|
#4 |
|
Guest
Posts: n/a
|
Hi Dmitry
unfortunately this doesn't do the trick, the text is still displayed from left to right. What I'm looking for is the ability to change the paragraph format, as in the menu: Format - Paragraph - Direction - Right to left The codepage I'm using is 1255 btw. Gal "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... > Instead of setting the Body property, set the HTMLBody to a formatted HTML > text. > You can also try to set the MailItem.InternetCodepage property to an > appropriate code page. > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message > news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >> Hi >> I'm trying to send a Right to Left Email from access. >> I'm trying to find a way for the text to be aligned to the right and to >> be written from the Right to the Left. >> I'm not using the >> DoCmd.SendObject , , , , , , strSubject, strMsg >> code as I can't find a way pass the RTL ref into it. >> I'm trying to use the Outlook VBA to do this but I can't find the way to >> do this. >> This is my current code: >> >> ' Vars >> Dim strMsg As String >> Dim strSubject >> Dim olApp As New Outlook.Application >> Dim olNameSpace As Outlook.NameSpace >> Dim olMail As Outlook.MailItem >> ' Open an Outlook object >> Set olNameSpace = olApp.GetNamespace("MAPI") >> Set olMail = olApp.CreateItem(olMailItem) >> ' Message text >> strMsg = "The message text" >> strSubject = "Subject Line text" >> ' Open message >> With olMail >> .Subject = strSubject >> .BodyFormat = olFormatRichText >> .Body = strMsg >> .Display >> End With >> >> thanks for your help >> >> Gal >> > > |
|
|
|
#5 |
|
Guest
Posts: n/a
|
Oops
Thank you, sorry, I missed that. I would have still liked to find a way to change the paragraph direction and using rtf format, but this is a very good solution. thanks again Gal "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:ee17v7DiFHA.1244@TK2MSFTNGP14.phx.gbl... > So did you try to set the HTMLBody property to an HTML string that > specifies the right alignment? > <p align="right">...</p> > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message > news:OTQyz3DiFHA.3316@TK2MSFTNGP14.phx.gbl... >> Hi Dmitry >> unfortunately this doesn't do the trick, the text is still displayed from >> left to right. >> What I'm looking for is the ability to change the paragraph format, as in >> the menu: >> Format - Paragraph - Direction - Right to left >> >> The codepage I'm using is 1255 btw. >> >> Gal >> >> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >> news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... >>> Instead of setting the Body property, set the HTMLBody to a formatted >>> HTML text. >>> You can also try to set the MailItem.InternetCodepage property to an >>> appropriate code page. >>> >>> Dmitry Streblechenko (MVP) >>> http://www.dimastr.com/ >>> OutlookSpy - Outlook, CDO >>> and MAPI Developer Tool >>> >>> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >>> news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >>>> Hi >>>> I'm trying to send a Right to Left Email from access. >>>> I'm trying to find a way for the text to be aligned to the right and to >>>> be written from the Right to the Left. >>>> I'm not using the >>>> DoCmd.SendObject , , , , , , strSubject, strMsg >>>> code as I can't find a way pass the RTL ref into it. >>>> I'm trying to use the Outlook VBA to do this but I can't find the way >>>> to do this. >>>> This is my current code: >>>> >>>> ' Vars >>>> Dim strMsg As String >>>> Dim strSubject >>>> Dim olApp As New Outlook.Application >>>> Dim olNameSpace As Outlook.NameSpace >>>> Dim olMail As Outlook.MailItem >>>> ' Open an Outlook object >>>> Set olNameSpace = olApp.GetNamespace("MAPI") >>>> Set olMail = olApp.CreateItem(olMailItem) >>>> ' Message text >>>> strMsg = "The message text" >>>> strSubject = "Subject Line text" >>>> ' Open message >>>> With olMail >>>> .Subject = strSubject >>>> .BodyFormat = olFormatRichText >>>> .Body = strMsg >>>> .Display >>>> End With >>>> >>>> thanks for your help >>>> >>>> Gal >>>> >>> >>> >> >> > > |
|
|
|
#6 |
|
Guest
Posts: n/a
|
Just wanted to add one last thing.
The best result is using direction : rtl <P style="direction: rtl"> ... </P> Gal "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message news:%23kX9gEEiFHA.2560@TK2MSFTNGP10.phx.gbl... > Oops > Thank you, sorry, I missed that. > > I would have still liked to find a way to change the paragraph direction > and using rtf format, but this is a very good solution. > > thanks again > > Gal > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message > news:ee17v7DiFHA.1244@TK2MSFTNGP14.phx.gbl... >> So did you try to set the HTMLBody property to an HTML string that >> specifies the right alignment? >> <p align="right">...</p> >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >> news:OTQyz3DiFHA.3316@TK2MSFTNGP14.phx.gbl... >>> Hi Dmitry >>> unfortunately this doesn't do the trick, the text is still displayed >>> from left to right. >>> What I'm looking for is the ability to change the paragraph format, as >>> in the menu: >>> Format - Paragraph - Direction - Right to left >>> >>> The codepage I'm using is 1255 btw. >>> >>> Gal >>> >>> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >>> news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... >>>> Instead of setting the Body property, set the HTMLBody to a formatted >>>> HTML text. >>>> You can also try to set the MailItem.InternetCodepage property to an >>>> appropriate code page. >>>> >>>> Dmitry Streblechenko (MVP) >>>> http://www.dimastr.com/ >>>> OutlookSpy - Outlook, CDO >>>> and MAPI Developer Tool >>>> >>>> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >>>> news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >>>>> Hi >>>>> I'm trying to send a Right to Left Email from access. >>>>> I'm trying to find a way for the text to be aligned to the right and >>>>> to be written from the Right to the Left. >>>>> I'm not using the >>>>> DoCmd.SendObject , , , , , , strSubject, strMsg >>>>> code as I can't find a way pass the RTL ref into it. >>>>> I'm trying to use the Outlook VBA to do this but I can't find the way >>>>> to do this. >>>>> This is my current code: >>>>> >>>>> ' Vars >>>>> Dim strMsg As String >>>>> Dim strSubject >>>>> Dim olApp As New Outlook.Application >>>>> Dim olNameSpace As Outlook.NameSpace >>>>> Dim olMail As Outlook.MailItem >>>>> ' Open an Outlook object >>>>> Set olNameSpace = olApp.GetNamespace("MAPI") >>>>> Set olMail = olApp.CreateItem(olMailItem) >>>>> ' Message text >>>>> strMsg = "The message text" >>>>> strSubject = "Subject Line text" >>>>> ' Open message >>>>> With olMail >>>>> .Subject = strSubject >>>>> .BodyFormat = olFormatRichText >>>>> .Body = strMsg >>>>> .Display >>>>> End With >>>>> >>>>> thanks for your help >>>>> >>>>> Gal >>>>> >>>> >>>> >>> >>> >> >> > > |
|
|
|
#7 |
|
Guest
Posts: n/a
|
RTF format is not exposed through the Outlook Object Model. See
http://www.outlookcode.com/d/formatmsg.htm for you options. Dmitry Streblechenko (MVP) http://www.dimastr.com/ OutlookSpy - Outlook, CDO and MAPI Developer Tool "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message news:%23kX9gEEiFHA.2560@TK2MSFTNGP10.phx.gbl... > Oops > Thank you, sorry, I missed that. > > I would have still liked to find a way to change the paragraph direction > and using rtf format, but this is a very good solution. > > thanks again > > Gal > > "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message > news:ee17v7DiFHA.1244@TK2MSFTNGP14.phx.gbl... >> So did you try to set the HTMLBody property to an HTML string that >> specifies the right alignment? >> <p align="right">...</p> >> >> Dmitry Streblechenko (MVP) >> http://www.dimastr.com/ >> OutlookSpy - Outlook, CDO >> and MAPI Developer Tool >> >> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >> news:OTQyz3DiFHA.3316@TK2MSFTNGP14.phx.gbl... >>> Hi Dmitry >>> unfortunately this doesn't do the trick, the text is still displayed >>> from left to right. >>> What I'm looking for is the ability to change the paragraph format, as >>> in the menu: >>> Format - Paragraph - Direction - Right to left >>> >>> The codepage I'm using is 1255 btw. >>> >>> Gal >>> >>> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >>> news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... >>>> Instead of setting the Body property, set the HTMLBody to a formatted >>>> HTML text. >>>> You can also try to set the MailItem.InternetCodepage property to an >>>> appropriate code page. >>>> >>>> Dmitry Streblechenko (MVP) >>>> http://www.dimastr.com/ >>>> OutlookSpy - Outlook, CDO >>>> and MAPI Developer Tool >>>> >>>> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >>>> news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >>>>> Hi >>>>> I'm trying to send a Right to Left Email from access. >>>>> I'm trying to find a way for the text to be aligned to the right and >>>>> to be written from the Right to the Left. >>>>> I'm not using the >>>>> DoCmd.SendObject , , , , , , strSubject, strMsg >>>>> code as I can't find a way pass the RTL ref into it. >>>>> I'm trying to use the Outlook VBA to do this but I can't find the way >>>>> to do this. >>>>> This is my current code: >>>>> >>>>> ' Vars >>>>> Dim strMsg As String >>>>> Dim strSubject >>>>> Dim olApp As New Outlook.Application >>>>> Dim olNameSpace As Outlook.NameSpace >>>>> Dim olMail As Outlook.MailItem >>>>> ' Open an Outlook object >>>>> Set olNameSpace = olApp.GetNamespace("MAPI") >>>>> Set olMail = olApp.CreateItem(olMailItem) >>>>> ' Message text >>>>> strMsg = "The message text" >>>>> strSubject = "Subject Line text" >>>>> ' Open message >>>>> With olMail >>>>> .Subject = strSubject >>>>> .BodyFormat = olFormatRichText >>>>> .Body = strMsg >>>>> .Display >>>>> End With >>>>> >>>>> thanks for your help >>>>> >>>>> Gal >>>>> >>>> >>>> >>> >>> >> >> > > |
|
|
|
#8 |
|
Guest
Posts: n/a
|
Thanks again
I'm using HTML with direction:rtl. This is exactly what I needed. Gal "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message news:uziQreJiFHA.1048@tk2msftngp13.phx.gbl... > RTF format is not exposed through the Outlook Object Model. See > http://www.outlookcode.com/d/formatmsg.htm for you options. > > Dmitry Streblechenko (MVP) > http://www.dimastr.com/ > OutlookSpy - Outlook, CDO > and MAPI Developer Tool > > "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message > news:%23kX9gEEiFHA.2560@TK2MSFTNGP10.phx.gbl... >> Oops >> Thank you, sorry, I missed that. >> >> I would have still liked to find a way to change the paragraph direction >> and using rtf format, but this is a very good solution. >> >> thanks again >> >> Gal >> >> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >> news:ee17v7DiFHA.1244@TK2MSFTNGP14.phx.gbl... >>> So did you try to set the HTMLBody property to an HTML string that >>> specifies the right alignment? >>> <p align="right">...</p> >>> >>> Dmitry Streblechenko (MVP) >>> http://www.dimastr.com/ >>> OutlookSpy - Outlook, CDO >>> and MAPI Developer Tool >>> >>> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >>> news:OTQyz3DiFHA.3316@TK2MSFTNGP14.phx.gbl... >>>> Hi Dmitry >>>> unfortunately this doesn't do the trick, the text is still displayed >>>> from left to right. >>>> What I'm looking for is the ability to change the paragraph format, as >>>> in the menu: >>>> Format - Paragraph - Direction - Right to left >>>> >>>> The codepage I'm using is 1255 btw. >>>> >>>> Gal >>>> >>>> "Dmitry Streblechenko" <dmitry@dimastr.com> wrote in message >>>> news:%23mTTVW9hFHA.576@tk2msftngp13.phx.gbl... >>>>> Instead of setting the Body property, set the HTMLBody to a formatted >>>>> HTML text. >>>>> You can also try to set the MailItem.InternetCodepage property to an >>>>> appropriate code page. >>>>> >>>>> Dmitry Streblechenko (MVP) >>>>> http://www.dimastr.com/ >>>>> OutlookSpy - Outlook, CDO >>>>> and MAPI Developer Tool >>>>> >>>>> "Gal Zilberman" <gal.zilberman@tns-teleseker.com> wrote in message >>>>> news:eXHPdI7hFHA.3260@TK2MSFTNGP10.phx.gbl... >>>>>> Hi >>>>>> I'm trying to send a Right to Left Email from access. >>>>>> I'm trying to find a way for the text to be aligned to the right and >>>>>> to be written from the Right to the Left. >>>>>> I'm not using the >>>>>> DoCmd.SendObject , , , , , , strSubject, strMsg >>>>>> code as I can't find a way pass the RTL ref into it. >>>>>> I'm trying to use the Outlook VBA to do this but I can't find the way >>>>>> to do this. >>>>>> This is my current code: >>>>>> >>>>>> ' Vars >>>>>> Dim strMsg As String >>>>>> Dim strSubject >>>>>> Dim olApp As New Outlook.Application >>>>>> Dim olNameSpace As Outlook.NameSpace >>>>>> Dim olMail As Outlook.MailItem >>>>>> ' Open an Outlook object >>>>>> Set olNameSpace = olApp.GetNamespace("MAPI") >>>>>> Set olMail = olApp.CreateItem(olMailItem) >>>>>> ' Message text >>>>>> strMsg = "The message text" >>>>>> strSubject = "Subject Line text" >>>>>> ' Open message >>>>>> With olMail >>>>>> .Subject = strSubject >>>>>> .BodyFormat = olFormatRichText >>>>>> .Body = strMsg >>>>>> .Display >>>>>> End With >>>>>> >>>>>> thanks for your help >>>>>> >>>>>> Gal >>>>>> >>>>> >>>>> >>>> >>>> >>> >>> >> >> > > |
|
![]() |
|
| Thread Tools | |
| Rate This Thread | |
|
|

Main Page 

