Outlook 2007 Macro For Views

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I found your macro that is perfect that I can use to adjust the view of folder of contacts and decide what fields to show...but the define field area is not saving the "Best Fit" area for each field.....Is there something to add to the macro or another macro to automatically bet fit all columns?

Sub GetAssignedView_All_Status_Fields()
Dim objViews As Views
Dim objView As View

' Applies view to select folder
Set objViews = Application.ActiveExplorer.CurrentFolder.Views
'Get the view
Set objView = objViews.item("View All Status Fields")

'apply the view
objView.Apply

End Sub
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Any chance to get the answer today???:confused:
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
With some of the views i create, the option to best fit is gray and cannot use it. And then, sometimes when i do it and save it, it does not save it going forward. So if there is a code that does it when I identify the view for the code, that would be great.
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
What type of view is it? Best Fit should be available for all fields in all table view (except for icons and yes/no). It's not used in other views.
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
Just the normal text fields for words....and it they are set up as a table.....and then sometimes the Best Fit shows up, I do it...I save it etc...and then it doesn't save it or later it doesn't work...so if we have a code that does it, then whenever I click on the macro it will do it for sure....any code to add please?
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
I understand. Thank you.
 

LMS

Senior Member
Outlook version
Outlook 2007
Email Account
Exchange Server
One more thought just in case you have an idea.

Here is the macro code from Excel where it identifies all columns and then automatically fits them based on the words in the columns to best fit. So any thoughts to turn this into a Outlook Code for the list of columns when I am viewing the contacts from the Contact folder or any subfolders etc.

Sub Bet_Fit_All_Columns()

'

' Bet_Fit_All_Columns Macro

'

'
Cells.Select
Range("J11").Activate
Selection.Columns.AutoFit

End Sub
 

Diane Poremsky

Senior Member
Outlook version
Outlook 2016 32 bit
Email Account
Office 365 Exchange
While some code can be tweaked to work in other office programs, this one can't - outlook doesn't use ranges and doesn't support Best Fit. Sorry.
 
Top