PC Review Forums Newsgroups Microsoft Outlook Microsoft Outlook VBA Programming Sending a Right to Left email from Access

Reply

Sending a Right to Left email from Access

 
Thread Tools Rate Thread
Old 13-07-2005, 03:52 PM   #1
Gal Zilberman
Guest
 
Posts: n/a
Default Sending a Right to Left email from Access


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


  Reply With Quote
Old 13-07-2005, 07:06 PM   #2
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>



  Reply With Quote
Old 14-07-2005, 07:40 AM   #3
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>>

>>
>>

>
>



  Reply With Quote
Old 14-07-2005, 08:33 AM   #4
Gal Zilberman
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>

>
>



  Reply With Quote
Old 14-07-2005, 08:56 AM   #5
Gal Zilberman
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 14-07-2005, 10:07 AM   #6
Gal Zilberman
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 14-07-2005, 06:15 PM   #7
Dmitry Streblechenko
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Old 19-07-2005, 02:29 PM   #8
Gal Zilberman
Guest
 
Posts: n/a
Default Re: Sending a Right to Left email from Access

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
>>>>>>
>>>>>
>>>>>
>>>>
>>>>
>>>
>>>

>>
>>

>
>



  Reply With Quote
Reply



Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off