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.
Related
I have created a task manager view in Microsoft Outlook which contains user defined fields as well as other Pre-defined fields in the view. I am trying to share this task manager with the rest of my team however, I cannot get it to show all of the columns as they appear on my screen on their screens. I am able to share the task manager but many of the columns are missing. It seems to be because the custom view I created isn't being shared with the other users. On my computer, the custom view is displayed and selected above "Simple list" under the Current View menu on the left and the others do no seem to have that as an option. Does anyone know how I can share the view? The tasks are already being shared I just need the View to be shared so my team can see all the columns properly. Thanks for any input you may have to offer.
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.
Use the CurrentView property of the Explorer or Folder classes to customize the View in Outlook. An XML definition of the view can be exported and transferred to another PC.
Ok essentially what I did was I went to view - current view - define views and created a new view selecting Table and This folder, visible to everyone. Then I found pre-definied columns that weren't user defined columns that allowed free text typing like subject, milage, and billing information. Once finished adding all the columns I needed I applied the view. Then I went and changed the name of the columns by right clicking each column header in the task manager and selecting format column. there you chan change the label name to whatever you want the column to be titled. This way you did not have to worry with using user defined columns that can be tricky to share. After that I went back to view - current view - define views, and made a copy of the view I created selecting this folder, visible to everyone. Then you will want to right on the tasks manager name you created under the My Tasks list and select properties. Make sure to give everyone your sharing it with full permissions as owners so that they can all edit the task manager as they finish each task. Then I shared this task manager by right clicking on the name of my newly created tasks manager (listed under the My Tasks menu) and selecting "share". I checked the box in the email stating recipient can add, edit, and delete items in this tasks folder. Now everyone can see all information displayed in each column and edit it as well hope this helps.
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.
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 am now designing a page for a windows 8 app.
the page has 2 parts, the left part will be like a list, when user select one item in the list, the right part will show the content based on the selection.
but I want to select different item in the left will display the different data in the right. For example, maybe select first item in the list, some text blocks will display on the right. select second item , an image will display on the right.
the data in the behind is a class which has some properties. I just want show this properties based on the selection in the list
so how to implement this? anyone has any idea?
thanks!
In the item template, create controls in separate panels for each different data type: text, image, video, etc. Then you can use a converter on each panel to inspect the data that it is bound to and show/hide the panels where appropriate. Depending on your data source, you might be evaluating either the class type or a property that contains an enumerated value that reveals the type, or maybe some more complex evaluation of the state of the class's properties.
One of the templates that comes with Visual Studio Express for Windows 8 supports this list and details view - look at the Split App template.
For more information, see:
http://msdn.microsoft.com/en-us/library/windows/apps/hh738343.aspx
I have my own derived WPF DataVisualization chart control and within that control, I have a boolean property that the designer can set which in turn creates and adds a line series to that chart control.
Now the problem is that I can easily create the line series object within the chart when the designer sets that property, but I also need to insert a complex xaml segment into the .xaml file associated with that newly created line series. Is there a way to automatically insert that xaml code into the xaml file when that boolean property is set in the blend designer?
Thanks
Leo
By default, the only properties you can expose are individual attributes on existing elements. There is no provision to insert new elements based on attribute changes. You only add elements by inserting new controls etc.
Create an extension for Expression Blend:
To do what you want you would need to create a plugin for Expression Blend. If you are in a position to do that then anything is possible (add entirely new tools and properties for instance):
Try this link for starters