When i am recalling a message in outlook, I get a lebel somthing like this in the sentmessage:
You attempted to recall this message on Monday, November 21, 2005 10:19 AM.
I want to take out this timing when the message was recalled.
Actually, I have written a script which recalls a message.
What i am doing is i am displaying the message and then clicking recal message button through my script. After this dialog box appears :
delete unread copies of this message..
...........
If i click ok then control comes back to my script and messagebox displays message has been recalled.
But, if user clicks cancel then also my code displays message box message has been recalled. Because i cant check which button is clicked?
So, after clicking any of the button on the dialog box i will check what is the recalled time of the message and if it matches with the system time then the message is recalled, otherwise if time dosn't match then message is not recalled.
So, can anyone has the method using which i can get the recall time of the message......
Thanks...
Last edited by v_gyku; Nov 21st, 2005 at 12:08 AM.
If Mid(outlook.Version, 1, 2) = "10" Then
item1.Display
Set pop = ActiveInspector.CommandBars(3).Controls(7)
pop.Controls(13).Execute
ActiveInspector.Close olDiscard
item1.Close olDiscard
end if
MsgBox "The selected e-mail(s) have been recalled.
I have written this code....
This displays the message and from that message clicks recall this message button, after this dialog box appears, after clicking any button it will do the functionality properly..(depends on which button is clicked). But if user has clicked cancel, still i am displaying message 'message has been recalled'.
After this dialog appears if user clicks cancel or any button control comes back to my code and displays messagebox as given in above code.
So i think if i can check the recall time of the message and if it matches with the system time then i can determine ok was clicked or cancel as clicked.
If ok is clicked then i wil get the following thing:
You attempted to recall this message on Monday, November 21, 2005 10:19 AM.
If this timing matches the system time then i can determine ok was clicked or else cancel was clicked...
Its not that kind of object. Its an Office.CommandBarButton object that displays a secondary message. If the .execute prompts this dialog then it still should have that info in the returning Action object.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
I think you may be making this more complicated then it has to be. If you get the returned Outlook Item boject you can access its properties to read the date/time.
Execute: Returns the Microsoft Outlook item created by the action.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Code example in post #6. If you take the returned item you can check the date/time the message was attemped to be recalled. If you get an item returned and its valid then the user must have clicked yes/ok. Then look at the items properties to see what you need.
VB/Office Guru™ (AKA: Gangsta Yoda™ ®)
I dont answer coding questions via PM. Please post a thread in the appropriate forum.
Sub fddfg()
Dim pop As CommandBarPopup
Dim mailib As MAPIFolder
Dim myitem As Outlook.MailItem
Dim co As CommandBar
Set mailib = Application.GetNamespace("mapi").GetDefaultFolder(olFolderSentMail)
Set myitem = mailib.Items.Item(1)
'Set co = myitem.GetInspector.CommandBars(4)
'MsgBox co.Name
'Dim myReply As Outlook.Action
'Dim str As String
'Set pop = myitem.GetInspector.CommandBars(4).Controls(7)
'str = pop.Controls(11).Caption
'myitem.Display
'Set myReply = myitem.Actions(pop.Controls(11).Caption).Execute
'myReply.Send
'End Sub
Dim myReply As Outlook.Action
Set myReply = myitem.Actions("Reply").Execute
myReply.Send
End Sub
Its giving me error type missed match on this line:
Dim myOlApp As Outlook.Application
Dim myItem As Outlook.MailItem
Dim myReply As Outlook.MailItem
Dim pop As CommandBarPopup
Set myOlApp = New Outlook.Application
Set myItem = myOlApp.GetNamespace("MAPI").GetDefaultFolder(olFolderSentMail).Items.Item(1)
Set myReply = myItem.Actions("Recall This Message").Execute
End Sub
if i put 'Forward' or 'Reply' or 'Reply to All' in above example it works.
But if i put 'Recall This Message' i get following error message:
Object variable or with block varibale not set...
For all items there is a menu acceleration key in caption
eg:- &Reply
If i use &Reply code dosn't work....gives error-- object variable or with block variable not set.(Its working with 'Reply')
In case of Recall This message code dosn't work either with 'Recall This Message' or 'Recall &This Message'.
If the user clicks cancel button in the dialog box, different messagebox should be displayed(eg. Message canot be reclled.)
As i have mentioned in above posts one way would be.....
Compare the system time with recalled time(recalled time is displayed in a lebel kind of thing) i have given screen shot in the earlier post.If both timings matches then message is recalled(i.e. ok is clicked).If timings dosn't match then message is not recalled(i.e. User has clicked cancel).....
I want to know how can i het the recaling time of the message.
Thanks...
Last edited by v_gyku; Nov 22nd, 2005 at 01:42 AM.