Export task list view settings to other pc

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#1
Hi

I run a one man consultancy service here in Denmark. Part of my business is onhandling mails and tasks in Outlook efficiently. One of my advices require a specific task list view setting, which the participants in my courses have to set up themselves guided by me in class. That's a drag and the faster ones are getting bored along the process.

Is there anyway that I could export my task list view settings and copy/install/export to the participants' pcs, so we could skip the set up process?

I am aware that the different versions and language setup of Outlook probably will require a version specific file/vba or whatever will solve the problem.

Kind regards
John
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#2

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#3
Thank you, Diane. I can get it to work with the mail view, but not with the task views, which are the ones I would like to share/export. The .pst file seems to disappear when I switch to tasks. I can still find it when I return to the inbox
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#4
Is there a task folder in the pst? Create a task folder in it then copy the Task view to it, using the 'this folder' view type.
 

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#5
Thanks for your patience :)

Yes, there is a task folder in the .pst - I've named it ExportViews. I even tried creating one more called "Opgaver" (danish for tasks). That didn't work either.

Maybe the problem is that when I switch to tasks the .pst file does not show? When I try to adding it I am forced back to the inbox even though I created the .pst from the task window.

I'll happily pay for your time if we can solve this.
 

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#9
Hi Michael

Thanks for the suggestion and your time. Unfortunately I'm not able to write macros. I get the idea though. I think I could send the macro to import in a seperate mail and let the users install the macro. Then import the view from a mail containing the xml property. That could work and it would accelerate the process. At the moment it takes about 30 minutes to set up the two views in question. Do you think that'll work?
 

Michael Bauer

Senior Member
Outlook version
Outlook 2010 32 bit
Email Account
Exchange Server
#10
To write the view into an email, replace everything within the first If and last End IF by this one:
Code:
Dim Mail as MailItem
set mail=application.createitem(0)
mail.body=sourcefolder.currentview.xml
mail.save
Make sure there´s only the view definition in the body, no signature etc.

This one saves the view from the email to the current folder. Have the user first open the email with the view, then select the folder where the view should be copied to:
Code:
sub Importview()
dim mail as mailitem
set mail=application.activeinspector.currentitem
dim view as view
set view=application.activeexplorer.currentfolder.view
view.xml=mail.body
view.apply
end sub
 

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#11
Thank you so much, Michael. I can now write the settings into a mail. But when I try to import it, I get an error message even though I follow your instructions.

When I try to debug it points to the line below ↓

Udklip.PNG


I have tried running the macro from the mail as well as from the tasks in the specific folder.

Do you have an idea what to do?

Thanks in advance.
John
 

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#12
Oh, just to be clear... it gives me the following message: Run time error '438': Object doesn't support this property or method.
 

JohnViuf

New Member
Outlook version
Outlook 2016 32 bit
Email Account
Exchange Server
#14
Thanks a lot, Michael. It works like a charm now. I am really grateful
 
Outlook version
Outlook 2016 32 bit
Email Account
IMAP
#15
When I run the first part of this,CopyView, the selector comes up and I select a task folder as a directory and then.. nothing. This is what I would expect as it is does copy. When I run the second part, ImportView, I get the error message "Run-time error '91': Object variable or With block variable not set" . When I click debug, the following code line is highlighted "Set mail = Application.ActiveInspector.CurrentItem" The complete script I am using is shown below.

Please advise - John


Public Sub CopyView()
Dim SourceFolder As Outlook.MAPIFolder
Dim TargetFolder As Outlook.MAPIFolder

Set SourceFolder = Application.Session.PickFolder

If Not SourceFolder Is Nothing Then

Dim mail As MailItem
Set mail = Application.CreateItem(0)
mail.Body = SourceFolder.CurrentView.XML
mail.Save

End If
End Sub

Sub Importview()
Dim mail As MailItem
Set mail = Application.ActiveInspector.CurrentItem
Dim view As view
Set view = Application.ActiveExplorer.CurrentFolder.CurrentView
view.XML = mail.Body
view.Apply
End Sub

vbsscript.png
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#16
Actually, ignore that - the code looks right. I need to read the rest of the thread. :)
The code in the screenshot is wrong - that is used for a message item - you need to use folder code
Set view = Application.ActiveExplorer.CurrentFolder.CurrentView
 
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
#17
Ok... I'm not getting an error when i run it - you need to have the message open that contains the view code (add mail.Display before the save line) - but adding the view to the other task folder isn't working.
 

Similar threads

Top