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

OL2003 & VB6:- "Could not send the message"



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old June 15th 09, 03:50 PM posted to microsoft.public.outlook.program_addins
Womble
external usenet poster
 
Posts: 4
Default OL2003 & VB6:- "Could not send the message"

I've got some code that I'm changing the reply method for.

In order to ensure the original message is not changed, I'm creating a copy
of the item but with the reply method I get a "Could not send the message" -
any thoughts. An extract from the relevent section:-

Set CurrMail = application.ActiveInspector.CurrentItem

Set NewMail = CurrMail.Copy()

Set NewFwd = NewMail.Reply

NewFwd.Display

I know it's the .Reply because if I replace NewMail.Reply with
Currmail.reply it works perfectly.
Ads
  #2  
Old June 15th 09, 06:36 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default OL2003 & VB6:- "Could not send the message"

Does it work better if you save the new copied item before calling Reply on
it?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
I've got some code that I'm changing the reply method for.

In order to ensure the original message is not changed, I'm creating a
copy
of the item but with the reply method I get a "Could not send the
message" -
any thoughts. An extract from the relevent section:-

Set CurrMail = application.ActiveInspector.CurrentItem

Set NewMail = CurrMail.Copy()

Set NewFwd = NewMail.Reply

NewFwd.Display

I know it's the .Reply because if I replace NewMail.Reply with
Currmail.reply it works perfectly.


  #3  
Old June 16th 09, 07:37 AM posted to microsoft.public.outlook.program_addins
Womble
external usenet poster
 
Posts: 4
Default OL2003 & VB6:- "Could not send the message"

Saving it first i.e. NewMail.Save makes no difference. I still get the same
error.

"Ken Slovak - [MVP - Outlook]" wrote:

Does it work better if you save the new copied item before calling Reply on
it?

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
I've got some code that I'm changing the reply method for.

In order to ensure the original message is not changed, I'm creating a
copy
of the item but with the reply method I get a "Could not send the
message" -
any thoughts. An extract from the relevent section:-

Set CurrMail = application.ActiveInspector.CurrentItem

Set NewMail = CurrMail.Copy()

Set NewFwd = NewMail.Reply

NewFwd.Display

I know it's the .Reply because if I replace NewMail.Reply with
Currmail.reply it works perfectly.



  #4  
Old June 16th 09, 01:48 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default OL2003 & VB6:- "Could not send the message"

Then I'm inclined to think it's a timing problem. If putting a DoEvents in
between saving the item and calling Reply doesn't do the trick then after
saving get NewItem.EntryID, release all references to the objects and get a
new object using the saved EntryID and NameSpace.GetItemFromID() and see if
that does the trick.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
Saving it first i.e. NewMail.Save makes no difference. I still get the
same
error.


  #5  
Old June 16th 09, 03:30 PM posted to microsoft.public.outlook.program_addins
Womble
external usenet poster
 
Posts: 4
Default OL2003 & VB6:- "Could not send the message"

Ken,

Thanks for that, the DoEvents didn't work. But the GetItemFromID() approach
did.

Unfortnatly, that moved me onto another hurdle.

The reason I'm copying is that I'm modifying the reply method, and wanted to
ensure that the original item was not affected. And this works fine as I
expected - except when I have an open attachment. The Currmail.Copy code
gives me a "An attachment to this message may be currently open in another
program......" message.

If I click YES to continue, the codes works fine. If NO, then NewMail is
empty and the code falls over with Object Expected.

Any thoughts, as to how I can work around this.

"Ken Slovak - [MVP - Outlook]" wrote:

Then I'm inclined to think it's a timing problem. If putting a DoEvents in
between saving the item and calling Reply doesn't do the trick then after
saving get NewItem.EntryID, release all references to the objects and get a
new object using the saved EntryID and NameSpace.GetItemFromID() and see if
that does the trick.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
Saving it first i.e. NewMail.Save makes no difference. I still get the
same
error.



  #6  
Old June 16th 09, 07:04 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default OL2003 & VB6:- "Could not send the message"

Umm, don't open the attachment?

Or handle the AttachmentRead() event on that item. That will tell you the
attachment was opened, use that to get the hWnd of the attachment window
using a Win32 API call such as FindWindow(), then send or post a WM_CLOSE
message to that window when you want to close the attachment window.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
Ken,

Thanks for that, the DoEvents didn't work. But the GetItemFromID()
approach
did.

Unfortnatly, that moved me onto another hurdle.

The reason I'm copying is that I'm modifying the reply method, and wanted
to
ensure that the original item was not affected. And this works fine as I
expected - except when I have an open attachment. The Currmail.Copy code
gives me a "An attachment to this message may be currently open in another
program......" message.

If I click YES to continue, the codes works fine. If NO, then NewMail is
empty and the code falls over with Object Expected.

Any thoughts, as to how I can work around this.


  #7  
Old June 16th 09, 10:03 PM posted to microsoft.public.outlook.program_addins
Womble
external usenet poster
 
Posts: 4
Default OL2003 & VB6:- "Could not send the message"

Unfortunatlly asking the users to close the attachment before clicking the
new button isn't really an option - similar with getting the code to close
the attachment prior to the copy.

Because I'm trying to code my own reply behaviour within an attatchment i.e.
I want to Create a "Reply with History" button while leaving the default
behaviour of Outlook to be Reply without history. Therefore when I had
issues around the behviour of Outlook when changing the properties of the
email, I felt that copying the item was the best approach.

Anu thoughts as to how Outlook manage it, because it's own reply button
doesn't prompt about an item being open when I use it's button.

"Ken Slovak - [MVP - Outlook]" wrote:

Umm, don't open the atachment?

Or handle the AttachmentRead() event on that item. That will tell you the
attachment was opened, use that to get the hWnd of the attachment window
using a Win32 API call such as FindWindow(), then send or post a WM_CLOSE
message to that window when you want to close the attachment window.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
...
Ken,

Thanks for that, the DoEvents didn't work. But the GetItemFromID()
approach
did.

Unfortnatly, that moved me onto another hurdle.

The reason I'm copying is that I'm modifying the reply method, and wanted
to
ensure that the original item was not affected. And this works fine as I
expected - except when I have an open attachment. The Currmail.Copy code
gives me a "An attachment to this message may be currently open in another
program......" message.

If I click YES to continue, the codes works fine. If NO, then NewMail is
empty and the code falls over with Object Expected.

Any thoughts, as to how I can work around this.



  #8  
Old June 17th 09, 04:20 PM posted to microsoft.public.outlook.program_addins
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default OL2003 & VB6:- "Could not send the message"

I have no idea how Outlook does things like that internally. For a reply the
attachments on the original message are always stripped out anyway though,
so that is likely the answer. You might want to look at saving any
attachments that you want on the reply to a temp folder in the file system,
then adding them to the reply message rather than making a copy of the
original message.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007.
Reminder Manager, Extended Reminders, Attachment Options.
http://www.slovaktech.com/products.htm


"Womble" wrote in message
news
Unfortunatlly asking the users to close the attachment before clicking the
new button isn't really an option - similar with getting the code to close
the attachment prior to the copy.

Because I'm trying to code my own reply behaviour within an attatchment
i.e.
I want to Create a "Reply with History" button while leaving the default
behaviour of Outlook to be Reply without history. Therefore when I had
issues around the behviour of Outlook when changing the properties of the
email, I felt that copying the item was the best approach.

Anu thoughts as to how Outlook manage it, because it's own reply button
doesn't prompt about an item being open when I use it's button.


 




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
fix send email after message "interface not registered" Rakko One Outlook - General Queries 17 May 18th 10 10:07 AM
Curious display question: Why does that GUI "box" that appears when hitting "Send/Receive" TM[_3_] Outlook Express 2 May 17th 08 12:13 AM
"Cannot send this meeting request.." message kristalhu Outlook - Calandaring 0 March 5th 07 06:14 PM
"Send Mail" error message when emailing Web page image Dave Outlook Express 7 December 31st 06 03:45 PM
can't send/receive in OL2003. "operation failed. object missing" sk Outlook - Installation 0 January 26th 06 01:40 PM


All times are GMT +1. The time now is 08:34 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.