A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Add-ins for Outlook
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Text from a different code page in outlook body



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old May 18th 07, 02:24 PM posted to microsoft.public.outlook.program_addins
Daniel
external usenet poster
 
Posts: 5
Default Text from a different code page in outlook body

Hi Folks,

I have an Outlook addin from which I'm trying to put localized text into the
body of an appointment item. I have a string of localized text, it's
cyrillic. I have my machines regional settings set to Russian. When I grab
the string from my resource file and try to put it in the body, it comes up
garbled, as if Outlook is displaying it in the wrong codepage. I'm sure the
localized string is correct. Similar localized strings come up just fine
when seen in the toolbar buttons of the addin. Additionally, we have
another outlook addin that seems to be able to print localized strings in
the body just fine. But for the life of me, I can't figure out the
difference between what that addin is doing and what I'm trying to do. I
know the old addin puts the body in the message upon pressing the "Send"
button where mine does it upon initial open of the appointment item. I know
that the old addin saves the appointment first (I've tried doing this to but
it didnt help). And I know the old addin uses mapi to open the body
property and uses mapi to read what's there before putting in the localized
text. My addin doesn't have to do any of that, but I'm going to try doing
some of that stuff to see if I can get the localized text to come up right.
Does anyone else have any ideas. Can I manually set the codepage of the body
somehow? It should already be set since I've switched the machines region
to Russian, but who knows.

I'm doing the below upon opening the appointment item.


szInvitationMsg = new TCHAR [dwSize];

MyFormatMessage(_pModule-GetResourceInstance(),
zInvitationMsg,
dwSize,
IDS_SCOPIA_INVITATION_MAIL,
(LPTSTR)CW2T (bstrDesktopInvite),
(LPTSTR)CW2T (bstrH323Invite),

(LPTSTR)CW2T (bstrPhoneInvite)
)

m_pAppointment-put_Body(CComBSTR(szInvitationMsg));

---------------
cod of MyFormat Message()

DWORD MyFormatMessage(HINSTANCE hInst, LPTSTR szDest, DWORD nSize, UINT
nFormatID, ...)
{
DWORD dwRes = 0;
TCHAR *szFormatString = new TCHAR[nSize];
va_list argList;
va_start(argList, nFormatID);

dwRes = ::LoadString(hInst, nFormatID, szFormatString, nSize);
if (dwRes)
{
dwRes = ::FormatMessage(FORMAT_MESSAGE_FROM_STRING ,
szFormatString, 0, 0,(LPTSTR)szDest, nSize, &argList);
ATLASSERT(dwRes 0);
DWORD dwErr = GetLastError();
dwErr = 0;
}
va_end(argList);
delete szFormatString;
return dwRes;
}



 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

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

Similar Threads
Thread Thread Starter Forum Replies Last Post
Import Outlook Body as text only into Access LI_SpeedyG Outlook and VBA 1 December 15th 06 03:40 PM
Outlook Language Code Page from MAPI C++ form m3driver Add-ins for Outlook 3 July 7th 06 06:23 PM
Outlook 2003 sending blank emails / text missing from body Keith Outlook - General Queries 3 June 1st 06 02:57 PM
vba code that insert a hyperlink file in the body of message gabriel Outlook and VBA 3 April 24th 06 02:51 PM
Outlook won't display body of plain text message Mike Outlook - General Queries 1 March 14th 06 07:54 PM


All times are GMT +1. The time now is 09:01 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.