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

Redemption: Recipients aren't added after CreateItemFromTemplate()



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old August 31st 06, 04:46 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 9
Default Redemption: Recipients aren't added after CreateItemFromTemplate()

Hi!

If I create an item by template, Outlook ignores setted recipients by
Redemption.SafeMailItem. The message always appears without recipient.
If I create the message by CreateItem(), the recipient appears:

--- test.js ---
var outlook = new ActiveXObject( "Outlook.Application" );
var session = outlook.GetNamespace( "MAPI" );
var strEntryID;
// --
session.Logon( "", "", false, false );
// --
{
var mail = outlook.CreateItemFromTemplate( "D:\\work\\vorlage.oft" );
// --
mail.Subject = "test";
mail.Attachments.Add( "D:\\work\\3827319625bsp.pdf" );
mail.Save();
// --
{
var smail = new ActiveXObject( "Redemption.SafeMailItem" );
// --
smail.Item = mail;
smail.Recipients.Add( " );
// --
mail.Save();
// --
smail = null;
}
// --
strEntryID = mail.EntryID;
// --
mail = null;
}
// --
{
var mail = session.GetItemFromID( strEntryID );
// --
mail.Display( true );
}
// --
session.Logoff();
--- test.js ---

(Redemption 4.12, Outlook 2000, Win 2000 Prof. SP4)

Does anyone has an idea what the problem could be here?

Thanks!

  #2  
Old August 31st 06, 07:13 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption: Recipients aren't added after CreateItemFromTemplate()

Thomas,
I replied yesterday to your question sent to my e-mail address (as as well
to your previous question). Have you received my reply?

----------------------------------

Try to use RDO family of objects alone to make sure Outlook does not even
see the message until GetItemfromID is called.




var outlook = new ActiveXObject( "Outlook.Application" );
var session = outlook.GetNamespace( "MAPI" );
var strEntryID;
// --
session.Logon( "", "", false, false );
// --
{
var RDOSession = new ActiveXObject( "Redemption.RDOSession" );

RDOSession.MAPIOBJECT = session.MAPIOBJECT;
var mail =
RDOSession.GetDefaultFolder(olFolderDrafts).Items. Add("IPM.Note")

Mail.Import("D:\\work\\vorlage.oft", olMsg);

// --
mail.Subject = "test";
mail.Attachments.Add( "D:\\work\\3827319625bsp.pdf" );

mail.Recipients.Add( " );
mail.Save();

strEntryID = mail.EntryID;

//now use OOM

//or you can call mail.Display(true) without even using OOM
var OutlookMail = session.GetItemFromID( strEntryID );
OutlookMail.Display( true );
}
// --
session.Logoff();



Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
oups.com...
Hi!

If I create an item by template, Outlook ignores setted recipients by
Redemption.SafeMailItem. The message always appears without recipient.
If I create the message by CreateItem(), the recipient appears:

--- test.js ---
var outlook = new ActiveXObject( "Outlook.Application" );
var session = outlook.GetNamespace( "MAPI" );
var strEntryID;
// --
session.Logon( "", "", false, false );
// --
{
var mail = outlook.CreateItemFromTemplate( "D:\\work\\vorlage.oft" );
// --
mail.Subject = "test";
mail.Attachments.Add( "D:\\work\\3827319625bsp.pdf" );
mail.Save();
// --
{
var smail = new ActiveXObject( "Redemption.SafeMailItem" );
// --
smail.Item = mail;
smail.Recipients.Add( " );
// --
mail.Save();
// --
smail = null;
}
// --
strEntryID = mail.EntryID;
// --
mail = null;
}
// --
{
var mail = session.GetItemFromID( strEntryID );
// --
mail.Display( true );
}
// --
session.Logoff();
--- test.js ---

(Redemption 4.12, Outlook 2000, Win 2000 Prof. SP4)

Does anyone has an idea what the problem could be here?

Thanks!



  #3  
Old September 1st 06, 09:35 AM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 9
Default Redemption: Recipients aren't added after CreateItemFromTemplate()

I replied yesterday to your question sent to my e-mail address (as as well
to your previous question). Have you received my reply?


Yes, I received it. But since I got problems with RDOSession and I
needed a quick solution I tried the newsgroup for alternatives.

  #4  
Old September 1st 06, 11:40 PM posted to microsoft.public.outlook.program_addins
Dmitry Streblechenko
external usenet poster
 
Posts: 2,116
Default Redemption: Recipients aren't added after CreateItemFromTemplate()

So did that script work Ok for you?

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool

wrote in message
ups.com...
I replied yesterday to your question sent to my e-mail address (as as
well
to your previous question). Have you received my reply?


Yes, I received it. But since I got problems with RDOSession and I
needed a quick solution I tried the newsgroup for alternatives.



  #5  
Old September 4th 06, 02:38 PM posted to microsoft.public.outlook.program_addins
[email protected]
external usenet poster
 
Posts: 9
Default Redemption: Recipients aren't added after CreateItemFromTemplate()

So did that script work Ok for you?

I could not use MAPIOBJECT of Outlook.Session, since we support Outlook
2000, but had to Logon. But with the COINIT_APARTMENTTHREADED parameter
for CoInitializeEx it works.

 




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
Catastrophic Failure while accessing Redemption.SafeMailItem.To and Recipients jisha Outlook and VBA 1 June 30th 06 06:48 PM
Deadlines Added Steve Weaver Outlook - General Queries 4 March 25th 06 10:55 PM
Redemption Christoph Add-ins for Outlook 5 March 6th 06 04:26 PM
createItemFromTemplate and VCF files [email protected] Add-ins for Outlook 1 February 9th 06 04:27 PM
Problems in Outlook 2003 SP2 - CreateItemFromTemplate Sledge Hammer Outlook - Using Forms 0 January 12th 06 11:01 AM


All times are GMT +1. The time now is 06:11 AM.


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.