Visual Basic Classic
--
Questions
--
Followers
Top Experts
I now need my users to have this code, but the mailbox "Update CPI" is a Shared Task folder in their mailbox which is what I want(see screenshot attachment for User Mailbox).
Can this line of my code be altered to access a Shared Task Folder?
"Set objFolder = GetFolder("UpdateCPI\Tasks
Here is my entire code:
Sub CopyTaskDDS()
'Check how many items need to create tasks
' DDS for Docketing
Select Case TypeName(Outlook.Application.ActiveWindow)
Case "Inspector"
CreateTaskfromObject Outlook.Application.ActiveInspector.CurrentItem
Case "Explorer"
Dim objItem As Object
For Each objItem In Outlook.Application.ActiveExplorer.Selection
CreateTaskfromObject objItem
Next
End Select
End Sub
Sub CreateTaskfromObject(objItem As Object)
' NOTE - This code uses CopyTaskDDS
' DDS for Docketing
Dim objTask As Outlook.TaskItem
Select Case objItem.Class
Case olTask
' Duplicate the task (DDS)
Dim objMainTask As TaskItem
Set objTask = Application.CreateItem(olTaskItem)
Set objMainTask = objItem
Set objTask = objMainTask.Copy
With objTask
' .Subject = "DDS of " & .Subject
.Subject = .Subject
.Save
' .Display
End With
End Select
'Close original task
With objMainTask
objItem.Close olSave
End With
' *** DDS MAILBOX ***
' *** Moves selected mail message to the DDS Task folder in the DDS mailbox ***
' NOTE - This code also uses GetFolder Function
Dim obj As Object
Dim i As Long
Dim Sel As Selection
Dim objFolder As Outlook.MAPIFolder
Dim objTasks As Outlook.MAPIFolder
Dim objNS As Outlook.NameSpace
Dim moveTo As Outlook.Folder
Set objNS = Application.GetNamespace("MAPI")
Set objTasks = objNS.GetDefaultFolder(olFolderTasks)
Set objFolder = GetFolder("UpdateCPI\Tasks")
Set Sel = Application.ActiveExplorer.Selection
For i = Sel.Count To 1 Step -1
Set obj = Sel(i)
Select Case True
Case (TypeOf obj Is Outlook.TaskItem), (TypeOf obj Is Outlook.ReportItem)
objTask.Move objFolder
End Select
Next
End Sub
Can anyone assist me. Thank you in advance!
Screenshot.jpg
Zero AI Policy
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
if the shared tasks permission should have the ability to write and edit.






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.
I just don't want to have to add this mailbox to every users mailbox in order for my code to work. It would be better if it is just a Shared folder in which my users have delegated rights.
did you modify the code as per my post ID: 40810336
it should work.
It appears to be working now, but I want to test further.
I'll be in touch.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Let me know how it goes
Accepted answer: 0 points for Senniger1's comment #a40810409
for the following reason:
This was exactly what I needed to make my code work. I really appreciate your help with this!
I think you have accepted your own comment as solution by mistake.
i hereby request Moderator to correct the aceepted answer to ID: 40810336






EARN REWARDS FOR ASKING, ANSWERING, AND MORE.
Earn free swag for participating on the platform.

Get a FREE t-shirt when you ask your first question.
We believe in human intelligence. Our moderation policy strictly prohibits the use of LLM content in our Q&A threads.
Visual Basic Classic
--
Questions
--
Followers
Top Experts
Visual Basic is Microsoft’s event-driven programming language and integrated development environment (IDE) for its Component Object Model (COM) programming model. It is relatively easy to learn and use because of its graphical development features and BASIC heritage. It has been replaced with VB.NET, and is very similar to VBA (Visual Basic for Applications), the programming language for the Microsoft Office product line.