Messages View problem

E

Exformatics

Hello,

When we use the Views collection on our Inbox the Messages View is changed.
Most columns are removed leaving only 3. It doesn't matter in what way we use
the Views collection.

We've tried:
Folder.Views("View Name")

Folder.Views(i)

For each oView in Folder.Views

We get the views from the Views collection alright but the Messages View is
corrupted every time we use any of the above ways of getting a view from the
collection.

I can't find anything on the net regarding this issue? Anybody here that
have any input?
 
K

Ken Slovak - [MVP - Outlook]

You get corruption just referencing the view? You don't change it or do
anything with or to it? I've never heard of anything like that. What version
of Outlook? Does this happen with more than one machine?

Does it help if you start Outlook using the /cleanviews startup switch? It
will remove any custom or customized views but if there is view corruption
of some sort it will remove it. Make sure Outlook is closed and open the
Start, Run dialog. In that dialog type the following, making sure that
there's a space before the /cleanviews switch:

outlook.exe /cleanviews

Then press Enter to start Outlook.
 
E

Exformatics

Hello Ken,

We get the corruption from just fetching a view from the Views collection.
We don't do anything to it. The thing is that we are fetching our own custom
made view. We aren't even touching the Messages View and still it gets
corrupted.

We are using Office 2007 and vb.net 2003. It doesn't happen to everybody but
enough that it needs to be resolved.

The thing is that we have an addin to Outlook and the operation causing the
problem is part of the addin and is run whenever Outlook is started. So it
doesn't help me restarting using the cleanviews switch.

I have checked the xml of our view and there are no syntax errors in there
at least. Our view works fine. It is also possible to reset the Messages
View. It then works as normal untill the next restart of outlook when it is
corrupted again.
 
K

Ken Slovak - [MVP - Outlook]

Just fetching a view from the collection should not ever corrupt that Views
collection. I've never seen that happen. There's always something else,
either some malformed view XML or corruption.

If you won't try the startup switch to see if that helps I can't be of any
help to you. If you decide to try it post back here and we can take it from
there. If you do post back please show the code you use to access the views
and to create your custom view.
 
E

Exformatics

The startup switch did the folowing:
1) removed our custom view and restored the Messages View.

However, once I restarted Outlook normaly our custom view was created again
and the Message View was corrupted.

To fetch the views we do this:

To create our custom view we do this:

Dim oView As Microsoft.Office.Interop.Outlook.View
oView = oFolder.Views.Add(strView,
Microsoft.Office.Interop.Outlook.OlViewType.olTableView,
Microsoft.Office.Interop.Outlook.OlViewSaveOption.olViewSaveOptionAllFoldersOfType)

Dim sb As New StringBuilder, iPos As Integer
sb.Append(oView.XML)

Dim sbView As New StringBuilde
sbView.Append("<column><heading>?</heading><prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/DLTrack</prop><type>boolean</type><width>1</width><style>padding-left:3px;;text-align:center</style><format>boolicon</format><displayformat>3</displayformat><userheading>?</userheading></column>")
sbView.Append(vbCrLf
sbView.Append(" <column><heading>Company</heading><prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/DLCompany</prop><type>string</type><width>151</width><style>padding-left:3px;;text-align:left</style><displayformat>1</displayformat><userheading>Company</userheading></column>")
sbView.Append(vbCrLf)
sbView.Append(" ")

iPos = sb.ToString.IndexOf("<heading>From")
sb.Insert(iPos - 1, sbView.ToString)

sbView = Nothing
oView.XML = sb.ToString
sb = Nothing
oView.Save()


The oView.XML looks like this:

<?xml version="1.0"?>
<view type="table">
<viewname>Exformatics Messages</viewname>
<viewstyle>table-layout:fixed;width:100%;font-family:Segoe
UI;font-style:normal;font-weight:normal;font-size:8pt;color:Black;font-charset:0</viewstyle>
<viewtime>215162475</viewtime>
<linecolor>8421504</linecolor>
<linestyle>3</linestyle>
<ensuredcategoriesfield>1</ensuredcategoriesfield>
<collapsestate/>
<rowstyle>background-color:window;color:windowtext</rowstyle>
<headerstyle>background-color:#D3D3D3</headerstyle>
<arrangement>
<autogroup>1</autogroup>
<collapseclient/>
</arrangement>
<column>
<name>HREF</name>
<prop>DAV:href</prop>
<checkbox>1</checkbox>
</column>
<column>
<heading>Importance</heading>
<prop>urn:schemas:httpmail:importance</prop>
<type>i4</type>
<bitmap>1</bitmap>
<width>10</width>
<style>padding-left:3px;;text-align:center</style>
<editable>1</editable>
</column>
<column>
<format>boolicon</format>
<heading>Reminder</heading
<prop>http://schemas.microsoft.com/mapi/id/{00062008-0000-0000-C000-000000000046}/8503000b</prop>
<type>boolean</type>
<bitmap>1</bitmap>
<width>18</width>
<style>padding-left:3px;;text-align:center</style>
<editable>1</editable>
<displayformat>3</displayformat>
</column>
<column>
<heading>Icon</heading>
<prop>http://schemas.microsoft.com/mapi/proptag/0x0fff0102</prop>
<bitmap>1</bitmap>
<width>18</width>
<style>padding-left:3px;;text-align:center</style>
<editable>0</editable>
</column>
<column>
<heading>Flag Status</heading>
<prop>http://schemas.microsoft.com/mapi/proptag/0x10900003</prop>
<type>i4</type>
<bitmap>1</bitmap>
<width>18</width>
<style>padding-left:3px;;text-align:center</style>
<editable>1</editable>
</column>
<column>
<format>boolicon</format>
<heading>Attachment</heading>
<prop>urn:schemas:httpmail:hasattachment</prop>
<type>boolean</type>
<bitmap>1</bitmap>
<width>10</width>
<style>padding-left:3px;;text-align:center</style>
<editable>0</editable>
<displayformat>3</displayformat>
</column>
<column>
<editable>0</editable>
<format>boolicon</format>
<heading>?</heading
<prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/DLTrack</prop>
<type>boolean</type>
<width>1</width>
<style>padding-left:3px;;text-align:center</style>
<displayformat>3</displayformat>
</column>
<column>
<editable>0</editable>
<heading>Company</heading
<prop>http://schemas.microsoft.com/mapi/string/{00020329-0000-0000-C000-000000000046}/DLCompany</prop>
<type>string</type>
<width>151</width>
<style>padding-left:3px;;text-align:left</style>
<displayformat>1</displayformat>
</column>
<column>
<heading>From</heading>
<prop>urn:schemas:httpmail:fromname</prop>
<type>string</type>
<width>25</width>
<style>padding-left:3px;;text-align:left</style>
<editable>0</editable>
<displayformat>1</displayformat>
</column>
<column>
<heading>Subject</heading>
<prop>urn:schemas:httpmail:subject</prop>
<type>string</type>
<width>120</width>
<style>padding-left:3px;;text-align:left</style>
<editable>1</editable>
</column>
<column>
<heading>Received</heading>
<prop>urn:schemas:httpmail:datereceived</prop>
<type>datetime</type>
<width>30</width>
<style>padding-left:3px;;text-align:left</style>
<editable>0</editable>
<format>M/d/yyyy||h:mm tt</format>
<displayformat>2</displayformat>
</column>
<column>
<heading>Size</heading>
<prop>http://schemas.microsoft.com/mapi/id/{00020328-0000-0000-C000-000000000046}/8ff00003</prop>
<type>i4</type>
<width>15</width>
<style>padding-left:3px;;text-align:left</style>
<editable>0</editable>
<displayformat>3</displayformat>
</column>
<column>
<heading>Categories</heading>
<prop>urn:schemas-microsoft-com:eek:ffice:eek:ffice#Keywords</prop>
<width>30</width>
<sortable>0</sortable>
<style>padding-left:3px;;text-align:left</style>
<editable>1</editable>
</column>
<orderby>
<order>
<heading>Received</heading>
<prop>urn:schemas:httpmail:datereceived</prop>
<type>datetime</type>
<sort>desc</sort>
</order>
</orderby>
<groupbydefault>2</groupbydefault>
<previewpane>
<visible>1</visible>
<markasread>0</markasread>
</previewpane>
</view>

/Martin
 
E

Exformatics

Forgot to include the code for fetching the views. The actual code that
corrupts the Message View:

Dim oView As Microsoft.Office.Interop.Outlook.View = Nothing
oView = Folder.Views(strView) '<-- this is where the Message View is
corrupted.
Return oView

Folder is the local Inbox.

/Martin
 
K

Ken Slovak - [MVP - Outlook]

I don't see anything wrong with the code or the view XML, certainly not
anything that would cause any view corruption of the Message view. I'd also
be wary of thinking anything is wrong with the code if it isn't corrupting
everyone's views universally. I'd be more inclined to suspect some other
factor common on systems where the corruption is occurring.

What is the value of strView in the line?

oView = Folder.Views(strView)

If you use a different string value does the view still become corrupted
where the corruption is happening now?

Here's an odd thought that just might be worth trying. Does it make a
difference if you change the problem line to this?

oView = Folder.Views.Item(strView)
 
E

Exformatics

Hello Ken,

Doing

oView = Folder.Views.Item(strView)

doesn't change anything. I think I have tried all variations you can for
fetching items from the collection. I have also tried fetching them by
looping the collection and using the integer index option.

strView is our name for our custom view. It's "Exformatics Messages" its
defined as a const.

/Martin
 
K

Ken Slovak - [MVP - Outlook]

I tried your view XML on a test machine here and the code you're using and
had no problems, as expected. I'm still convinced that the problem lies in
something on the machines where the corruption is happening, perhaps some
other software installed that integrates with Outlook.
 
E

Exformatics

We have tried creating 2 custom views. Fetching one of them, the new one,
doesn't cause any problems at all. The same code is used to create and fetch
both views.

Could this problem be related to different language versions of
Ofiice/Windows?

/Martin
 
K

Ken Slovak - [MVP - Outlook]

It possibly could be language, it's definitely something specific on the
computers where things are failing. The object model usage should be
language-independent and language neutral. Some parameters passed may be
different per language, but not object model calls.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top