![]() |
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. |
|
|
Thread Tools | Search this Thread | Display Modes |
#1
|
|||
|
|||
![]()
Hi,
i have develop an Add-In which save tasks in a non primary task-folder. I use the Outlook-Object-Modell (MAPI) to save the tasks. Always when my application save a task with a remindertime, a message like the follow appairs: "The reminder for ... will not displayed. Are you agreed vor this?" Is there a method to prevent this message? bye Oskar |
Ads |
#2
|
|||
|
|||
![]()
You could save the task to the user's default Tasks folder, then move it to the non-primary folder.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Oskar Vaia" wrote in message ... Hi, i have develop an Add-In which save tasks in a non primary task-folder. I use the Outlook-Object-Modell (MAPI) to save the tasks. Always when my application save a task with a remindertime, a message like the follow appairs: "The reminder for ... will not displayed. Are you agreed vor this?" Is there a method to prevent this message? bye Oskar |
#3
|
|||
|
|||
![]()
Hi Sue,
thx for the tip. I can resolve the problem with the move-method. ;-) But one question: My personalized Outlook-form starts by click a button (VB-Script) a vb.net-application. Here the VB-Script-code: --- sub commandbutton6_click() Dim CB5Caption CB5Source = 1 Set MB = CreateObject("InkassiOutlookTools.WordFunction") ' this is my vb.net-application call MB.Mahnbrieferstellung() msgbox "OK" CB5Source = 0 Item.Close olSave end sub --- In this application then i use the move-method. This works fine. After the vb.net-application have finished his work the vb-script-code of the form should finished his work. But nothing happens. Could it be, that the move-method in my vb.net-application automatically closes my outlook-item? bye Oskar |
#4
|
|||
|
|||
![]()
I'm very confused now. What object represents the new task that your code creates? How is running code on a form related to creating that new task?
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Oskar Vaia" wrote in message ... Hi Sue, thx for the tip. I can resolve the problem with the move-method. ;-) But one question: My personalized Outlook-form starts by click a button (VB-Script) a vb.net-application. Here the VB-Script-code: --- sub commandbutton6_click() Dim CB5Caption CB5Source = 1 Set MB = CreateObject("InkassiOutlookTools.WordFunction") ' this is my vb.net-application call MB.Mahnbrieferstellung() msgbox "OK" CB5Source = 0 Item.Close olSave end sub --- In this application then i use the move-method. This works fine. After the vb.net-application have finished his work the vb-script-code of the form should finished his work. But nothing happens. Could it be, that the move-method in my vb.net-application automatically closes my outlook-item? bye Oskar |
#5
|
|||
|
|||
![]()
Hi Sue,
i try to illustrate my problem for new: (sorry, but my english is not so good; maybe it will helps to learn it better if i frequently will write here in the newsgroup. :-) ) Well: my personalized task-form, which is into a new task-folder (not the primary task-folder) has a button therein, what i have create. When i click the button, a VB.NET procedure starts. Here is the VBScript-code behind the form, which respond to the button-click-event. --- sub commandbutton6_click() Dim CB5Caption CB5Source = 1 Set MB = CreateObject("InkassiOutlookTools.WordFunction") ' this is my VB.NET-application call MB.Mahnbrieferstellung() 'this is a procedure in the VB.NET-application msgbox "OK" CB5Source = 0 Item.Close olSave end sub --- So far i think my illustration is ok, right? Here is the code of the abovementioned VB.NET-procedu --- Dim myOlApp As New Outlook.Application Dim myNamespace As Outlook.NameSpace Dim myitem As Outlook.TaskItem Dim myitemP As Outlook.TaskItem Dim ReminderDate As DateTime, newReminderTime As DateTime myNamespace = myOlApp.GetNamespace("MAPI") myitem = myNamespace.GetItemFromID(strEntryID, objStoreID) ReminderDate = DateTime.UtcNow.AddDays(7) newReminderTime = New System.DateTime(ReminderDate.Year, ReminderDate.Month, ReminderDate.Day, 9, 0, 0) myitem.UserProperties("MB1").Value = DateTime.UtcNow myitem.UserProperties("Mahnung1").Value = True myitem.UserProperties("aktMahnstufe").Value = "1" myitem.Save() Dim myPTaskFolder As Outlook.MAPIFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks) myitem.Move(myPTaskFolder) Dim myFolder As Outlook.MAPIFolder Dim myFindItem As Outlook.TaskItem myFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks) myFindItem = myFolder.Items.Find("[GrID] = '401780208129.11.20021728.02.20040-1128.69RD010173'") myitemP = myNamespace.GetItemFromID(myFindItem.EntryID.ToStr ing, objStoreID) myitemP.ReminderSet = True myitemP.ReminderTime = newReminderTime myitemP.Save() Dim myPersTaskFolder As Outlook.MAPIFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks).Folders().Item("Inkassi") 'NEW myitemP.Move(myPersTaskFolder) myPersTaskFolder = Nothing myPTaskFolder = Nothing myNamespace = Nothing myOlApp = Nothing --- The variable "strEntryID" comprised the "EntryID" of the taskitem, which launches my VB.NET-procedure by click on the abovementioned button. The procedure changes some UserProperties.values on my opened taskitem, then it save the opened taskitem. Then the procedure moves the item to the primary task-folder. Then the procedure searches for the moved item in the primary task-folder. After that it sets the value for the properties "ReminderSet" and "ReminderTime". It saves the task-item in the primary task-folder. Then the procedure moves the modified task-item to the original position, back in the other task-folder. All this works fine and in this manner the user don't receive the message "The reminder for ... will not displayed. Are you agreed for this?". But here the cause, which don't fall me: when the VB.NET-procedure has finished his work and gives the control back to VBScript-code, so all the code after this code-line call MB.Mahnbrieferstellung() 'this is a procedure in the VB.NET-application didn't executed. When i debug my VBScript-code with the Microsoft Script Editor, so i can see, that when the VB.NET-procedure gives back the control to the VBScript code, this opens a few new "Script-elements", and it doesn't continue at the Script-element, from which it starts by click the button on my personalized task-form. Why this? I think the reason must relate to the "move-method" in the VB.NET-code. But i would use this manner to avoid the message "The reminder for ... will not displayed. Are you agreed for this?" Have you a tip, how it's possible to avoid the problem with the new open of the few "Script-elements" and how the VBScript code can continue his right way after he achieve back the control from the VB.NET-procedure? thx & bye Oskar |
#6
|
|||
|
|||
![]()
You shouldn't be moving an open item. If you're going to move it, close it first, then reopen it. If you're closing the item, setting CB5Source = 0 in code wouldn't seem to have any effect anyway, assuming CB5Source is a script variable.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Oskar Vaia" wrote in message ... Hi Sue, i try to illustrate my problem for new: (sorry, but my english is not so good; maybe it will helps to learn it better if i frequently will write here in the newsgroup. :-) ) Well: my personalized task-form, which is into a new task-folder (not the primary task-folder) has a button therein, what i have create. When i click the button, a VB.NET procedure starts. Here is the VBScript-code behind the form, which respond to the button-click-event. --- sub commandbutton6_click() Dim CB5Caption CB5Source = 1 Set MB = CreateObject("InkassiOutlookTools.WordFunction") ' this is my VB.NET-application call MB.Mahnbrieferstellung() 'this is a procedure in the VB.NET-application msgbox "OK" CB5Source = 0 Item.Close olSave end sub --- So far i think my illustration is ok, right? Here is the code of the abovementioned VB.NET-procedu --- Dim myOlApp As New Outlook.Application Dim myNamespace As Outlook.NameSpace Dim myitem As Outlook.TaskItem Dim myitemP As Outlook.TaskItem Dim ReminderDate As DateTime, newReminderTime As DateTime myNamespace = myOlApp.GetNamespace("MAPI") myitem = myNamespace.GetItemFromID(strEntryID, objStoreID) ReminderDate = DateTime.UtcNow.AddDays(7) newReminderTime = New System.DateTime(ReminderDate.Year, ReminderDate.Month, ReminderDate.Day, 9, 0, 0) myitem.UserProperties("MB1").Value = DateTime.UtcNow myitem.UserProperties("Mahnung1").Value = True myitem.UserProperties("aktMahnstufe").Value = "1" myitem.Save() Dim myPTaskFolder As Outlook.MAPIFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks) myitem.Move(myPTaskFolder) Dim myFolder As Outlook.MAPIFolder Dim myFindItem As Outlook.TaskItem myFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks) myFindItem = myFolder.Items.Find("[GrID] = '401780208129.11.20021728.02.20040-1128.69RD010173'") myitemP = myNamespace.GetItemFromID(myFindItem.EntryID.ToStr ing, objStoreID) myitemP.ReminderSet = True myitemP.ReminderTime = newReminderTime myitemP.Save() Dim myPersTaskFolder As Outlook.MAPIFolder = myNamespace.GetDefaultFolder(Outlook.OlDefaultFold ers.olFolderTasks).Folders().Item("Inkassi") 'NEW myitemP.Move(myPersTaskFolder) myPersTaskFolder = Nothing myPTaskFolder = Nothing myNamespace = Nothing myOlApp = Nothing --- The variable "strEntryID" comprised the "EntryID" of the taskitem, which launches my VB.NET-procedure by click on the abovementioned button. The procedure changes some UserProperties.values on my opened taskitem, then it save the opened taskitem. Then the procedure moves the item to the primary task-folder. Then the procedure searches for the moved item in the primary task-folder. After that it sets the value for the properties "ReminderSet" and "ReminderTime". It saves the task-item in the primary task-folder. Then the procedure moves the modified task-item to the original position, back in the other task-folder. All this works fine and in this manner the user don't receive the message "The reminder for ... will not displayed. Are you agreed for this?". But here the cause, which don't fall me: when the VB.NET-procedure has finished his work and gives the control back to VBScript-code, so all the code after this code-line call MB.Mahnbrieferstellung() 'this is a procedure in the VB.NET-application didn't executed. When i debug my VBScript-code with the Microsoft Script Editor, so i can see, that when the VB.NET-procedure gives back the control to the VBScript code, this opens a few new "Script-elements", and it doesn't continue at the Script-element, from which it starts by click the button on my personalized task-form. Why this? I think the reason must relate to the "move-method" in the VB.NET-code. But i would use this manner to avoid the message "The reminder for ... will not displayed. Are you agreed for this?" Have you a tip, how it's possible to avoid the problem with the new open of the few "Script-elements" and how the VBScript code can continue his right way after he achieve back the control from the VB.NET-procedure? thx & bye Oskar |
#7
|
|||
|
|||
![]()
Hi Sue,
i have do what you suggest me. The problem isn't the content of the variable CB5Source; the problem is, that the memoryload increases more than when i don't move the items from one folder to another and back. when i don't move the items by code, so the memoryload for the outlook-process is about 300 KB; when i move the items like the code in my previous posting, so the memoryload for the outlook-process is about 1500 KB. I don't understand why. I only notice, that when i use the Microsoft Script Editor to debug the forms-code, the opens Scriptelements doesn't all close. Is this perhaps the reason for the upper memory usage? thx & bye Oskar |
#8
|
|||
|
|||
![]()
That sounds like a different issue. You may need to release objects more aggressively in your add-in(Marshal.ReleaseCOMObject, GC.College, GC.WaitForPendingFinalizers). Setting objects to Nothing in your script code is also good practice.
-- Sue Mosher, Outlook MVP Author of Microsoft Outlook 2007 Programming: Jumpstart for Power Users and Administrators http://www.outlookcode.com/article.aspx?id=54 "Oskar Vaia" wrote in message ... Hi Sue, i have do what you suggest me. The problem isn't the content of the variable CB5Source; the problem is, that the memoryload increases more than when i don't move the items from one folder to another and back. when i don't move the items by code, so the memoryload for the outlook-process is about 300 KB; when i move the items like the code in my previous posting, so the memoryload for the outlook-process is about 1500 KB. I don't understand why. I only notice, that when i use the Microsoft Script Editor to debug the forms-code, the opens Scriptelements doesn't all close. Is this perhaps the reason for the upper memory usage? thx & bye Oskar |
Thread Tools | Search this Thread |
Display Modes | |
|
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
How to prevent Outlook meeting reminder notice from disappearing? | ADMIguy | Outlook - Calandaring | 1 | July 31st 07 07:13 AM |
Outlook 2003 will not open - Not Responding message every time I | Japes | Outlook - Installation | 0 | April 23rd 07 11:22 PM |
prevent e-mail message recipients automatically forward a message | IH | Outlook - Using Forms | 3 | November 1st 06 10:00 PM |
How to prevent appointments time update when changing time zone? | Samer | Outlook - Calandaring | 0 | April 2nd 06 05:24 PM |
Prevent Reminder bein created by outlook | Wolf | Add-ins for Outlook | 1 | February 6th 06 10:10 PM |