How can I set columns, filters, sorting and conditional formatting of an Outlook calendar view using VBA? Also, is there a way to export a view to share with other people and apply it using VBA?
How can I set columns, filters, sorting and conditional formatting of an Outlook calendar view using VBA?
Take a look at the following articles in MSDN:
Outlook Views
Filtering and Specifying Fields in a View
Sorting Fields in a View
You can find a sample code in the Programmatically Adding a Column to Your Outlook 2007 Inbox Table View article.
Also, is there a way to export a view to share with other people and apply it using VBA?
Yes, there is. You can export the XML markup of your View and then set it on another machine and then apply it to see the changes. The XML property of the View class (for example, TableView) returns a string value that specifies the XML definition of the view. The XML definition describes the view type by using a series of tags and keywords corresponding to various properties of the view itself. When the view is created, the XML definition is parsed to render the settings for the new view. To determine how the XML should be structured when creating views, you can create a view by using the Outlook user interface and then you can retrieve the XML property for that view.
Related
I am writing a add-in for outlook 2010 using VSTO and c#.
From my add-in at run time I want to append some text to the subject of certain email messages in outlook 2010's preview pane.
A screenshot of what I am trying to achieve is below. In the screenshot please note that some of the messages have '[work email]' appended to the subject in red text. That is what I am trying to achieve.
Is there any way of doing this either from c# or a macro?
You cannot do that. You can either modify the subject (but you won't be bale to show the string in a different color) or you can set a user defined property and configure the folder view to show the message in red if that property is present (View Settings | Conditional Formatting).
The Outlook object model doesn't provide anything for displaying a part of the Subject string using different colors.
A possible solution is to customize the CurrentView of the Explorer or Inspector objects. To obtain a View object for the view of the current Explorer, use Explorer.CurrentView instead of the CurrentView property of the current Folder object returned by Folder.CurrentFolder.
The View object allows you to create customizable views that allow you to better sort, group and ultimately view data of all different types. There are a variety of different view types that provide the flexibility needed to create and maintain your important data.
The table view type (olTableView) allows you to view data in a simple field-based table.
The Calendar view type (olCalendarView) allows you to view data in a calendar format.
The card view type (olCardView) allows you to view data in a series of cards. Each card displays the information contained by the item and can be sorted.
The icon view type (olIconView) allows you to view data as icons, similar to a Windows folder or explorer.
The timeline view type (olTimelineView) allows you to view data as it is received in a customizable linear time line.
Views are defined and customized using the View object's XML property. The XML property allows you to create and set a customized XML schema that defines the various features of a view.
The XML definition describes the view type by using a series of tags and keywords corresponding to various properties of the view itself. When the view is created, the XML definition is parsed to render the settings for the new view.
To determine how the XML should be structured when creating views, you can create a view by using the Outlook user interface and then you can retrieve the XML property for that view.
To programmatically add a custom field to a view, use the Add method of the ViewFields object. This is the recommended way to dynamically change the view over setting the XML property of the View object.
I am looking for a good practice in this scenario: I am working with Expression Blend, and want to create a datatemplate for the items in a listbox. I already have project with a model class, lets call it User which will be the holder of data to be displayed in the ListBox items. And what I want to do is to get some sample data containing users that can be bound to the listbox to view the design work in progress.
Microsofts idea with Blend is for it to rid the need of programming skills for designer folks in the process of creating the UI. So I was expecting there to be a way to generate a sample data based on the pre existing code, in this case User class, without any coding.
The proposed solutions that can be done from Blend that I've seen are either, generate an xml-file with elements of type User, and then create a sample data source out of this and bind it to the ListBox. Or, select "new sample data" in the Data tab which will create a collection of a new type with a set of properties that can be managed from Blend. None of theses options are what I am looking for, the first since it will demand the user to precreate an xml file, which is not part of a designers job, the second doesn't meet the requirement of being a data source containing the relevant type, User.
On the Data tab, "Create Sample Data" button, there is an option for "Create Sample Data from Class". As long as the class is already defined and referenced in the project, I think this will do what you want.
I would like to create a list with some External Data fields (and other fields) and customize it in Infopath, but it's not working.. InfoPath says:
The following fields in the SharepPoint list are not supported because
of their data type and will not be available in InfoPath Designer:
-field_1 (BusinessData)
-field_2 (BusinessData)
Is it possible to use an External Content Type (WCF Service) with a list in Infopath?
I mean, use an External Item Picker in a Infopath form that connects to a list. Or is it only possible with a Form Library?
Any ideas on how to solve this or a suggestion to another approach?
Thanks in advance.
It is possible to create the scenario you're referring to... if I understand you correctly, you want to use the External Item Picker to create a pick list within an external list against another list.
You would have to associate the two external lists (ECTs) within your BCS model. This association must be a foreign key based association. That done, SharePoint will automatically create an External Item Picker in the default list form.
I'm currently doing the same thing and it works for me in Sharepoint. However, when I modify the form in Infopath, I start to get errors whenever I select an item in the External Item Picker. As long as I don't use InfoPath to modify the form, it works fine in SharePoint.
I hope this answers your question.
Cheers!
Is it possible to create an Alert which should only fire when certain field value is blank or something like that ? I don't find any reference for the same anywhere.
If your alert criteria can be expressed in a view, you can then do this through the UI without code. Create the view on the list with your criteria. Then set an alert for the list. In the section for set alerts for these changes, select the someone changes an item that appears in this view and select your view from the dropdown list.
This option is not easily discovered in 2010 as the option only appears after a custom view exists for the list (except for the task list, which has a number of views included by default).
You can create a workflow through SharePoint designer to achieve this functionality.
I created a custom field type that inherits from SPFieldNumber. Then I created a column of this type in a list and created a Gantt View.
The problem is that the column doesn't show in the Gantt view's left pane.
Any help on this issue would be much appreciated.
Thanks!
In SharePoint 2010 fields UI is rendered using XSL Transformation, so to get you field rendered in List View you need to write a Custom XSL for your Field you developed.
Below article will get you needed help
MSDN Article
Reference Article