A Microsoft Outlook email forum. Outlook Banter

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » Outlook Banter forum » Microsoft Outlook Email Newsgroups » Outlook and VBA
Site Map Home Register Authors List Search Today's Posts Mark Forums Read Web Partners

Custom view is not working



 
 
Thread Tools Search this Thread Display Modes
  #1  
Old October 13th 07, 04:05 PM posted to microsoft.public.outlook.program_vba
Dhananjay
external usenet poster
 
Posts: 33
Default Custom view is not working

Hi All,
I am creating custom view. Following is my code snippet of one of my
commandbar button.

'-------------------------------------------------------------------------------------------------------------------
myView = CustomPublicFolder.Views("By Company")
myView.Reset()
myView.Apply()
AddTrace("Company View obtained")
objXML = CreateObject("MSXML2.DOMDocument.4.0")
AddTrace("XML object created")
' load into xml parser
objXML.loadXML(myView.XML)
AddTrace("XML Loaded")
objRoot = objXML.documentElement
AddTrace("Root obtained")
newNode = objXML.createNode(1, "filter", "")
AddTrace("Filter node created")
newNode.Text = """http://schemas.microsoft.com/mapi/string/
{00020329-0000-0000-C000-000000000046}/myCustomField"" LIKE '%" &
FilterType & "%'"
AddTrace("Filter applied - " & FilterType)
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View Saved partially")
If objRoot.selectSingleNode("groupbydefault") Is Nothing
Then
newNode = objXML.createNode(1, "groupbydefault", "")
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
Else
newNode = objRoot.selectSingleNode("groupbydefault")
End If
newNode.Text = "1"
AddTrace("Created collapsed view of company")
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View saved")
myView.Apply()
'-------------------------------------------------------------------------------------------------------------------
This code is working fine on all of our machines (with clean machines
too). But on one of our client machine it is not working. If I print
myView.xml in the trace file then it is showing me perfect xml, but
view is not applied successfully.
My addin is VSTO addin for office 2003 in VB2005.

Thanks,
Dhananjay

  #2  
Old October 13th 07, 07:47 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom view is not working

And what's not working?

If it's not showing the custom property is that property on those items and
added to the folder properties?

Other than that you're going to have to find out what's different about your
machines and where it's not working.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
oups.com...
Hi All,
I am creating custom view. Following is my code snippet of one of my
commandbar button.

'-------------------------------------------------------------------------------------------------------------------
myView = CustomPublicFolder.Views("By Company")
myView.Reset()
myView.Apply()
AddTrace("Company View obtained")
objXML = CreateObject("MSXML2.DOMDocument.4.0")
AddTrace("XML object created")
' load into xml parser
objXML.loadXML(myView.XML)
AddTrace("XML Loaded")
objRoot = objXML.documentElement
AddTrace("Root obtained")
newNode = objXML.createNode(1, "filter", "")
AddTrace("Filter node created")
newNode.Text = """http://schemas.microsoft.com/mapi/string/
{00020329-0000-0000-C000-000000000046}/myCustomField"" LIKE '%" &
FilterType & "%'"
AddTrace("Filter applied - " & FilterType)
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View Saved partially")
If objRoot.selectSingleNode("groupbydefault") Is Nothing
Then
newNode = objXML.createNode(1, "groupbydefault", "")
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
Else
newNode = objRoot.selectSingleNode("groupbydefault")
End If
newNode.Text = "1"
AddTrace("Created collapsed view of company")
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View saved")
myView.Apply()
'-------------------------------------------------------------------------------------------------------------------
This code is working fine on all of our machines (with clean machines
too). But on one of our client machine it is not working. If I print
myView.xml in the trace file then it is showing me perfect xml, but
view is not applied successfully.
My addin is VSTO addin for office 2003 in VB2005.

Thanks,
Dhananjay


  #3  
Old October 15th 07, 11:02 AM posted to microsoft.public.outlook.program_vba
Dhananjay
external usenet poster
 
Posts: 33
Default Custom view is not working

Thanks Ken for your valuable reply,
And what's not working?

Ans: My view is not working. Custom property is added to folder
properties.
Now, as per Sue suggested, I selected different folder first & then
selected my custom folder again, it is showing me the currect view!!
So I changed the folder programmatically to inbox or contacts folder &
then switch back to my custom public folder. It works for 2 times &
after that, control remains in the Inbox folder, so I had to select my
custom folder again manually. Any ideas?

Other than that you're going to have to find out what's different about your
machines and where it's not working.

Ans: I checked on "working" computer & "not working" computer for
environment, I found that
OS is same on both PCs (Windows XP)
SP of OS is same (SP 2)
All updates are fine for OS
Office 2003 SP3 is same on both PCs
User account rights are same on both PCs
What else I should check?
Thanks again,
Dhananjay

Ken Slovak - [MVP - Outlook] wrote:
And what's not working?

If it's not showing the custom property is that property on those items and
added to the folder properties?

Other than that you're going to have to find out what's different about your
machines and where it's not working.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
oups.com...
Hi All,
I am creating custom view. Following is my code snippet of one of my
commandbar button.

'-------------------------------------------------------------------------------------------------------------------
myView = CustomPublicFolder.Views("By Company")
myView.Reset()
myView.Apply()
AddTrace("Company View obtained")
objXML = CreateObject("MSXML2.DOMDocument.4.0")
AddTrace("XML object created")
' load into xml parser
objXML.loadXML(myView.XML)
AddTrace("XML Loaded")
objRoot = objXML.documentElement
AddTrace("Root obtained")
newNode = objXML.createNode(1, "filter", "")
AddTrace("Filter node created")
newNode.Text = """http://schemas.microsoft.com/mapi/string/
{00020329-0000-0000-C000-000000000046}/myCustomField"" LIKE '%" &
FilterType & "%'"
AddTrace("Filter applied - " & FilterType)
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View Saved partially")
If objRoot.selectSingleNode("groupbydefault") Is Nothing
Then
newNode = objXML.createNode(1, "groupbydefault", "")
filterNode = objRoot.insertBefore(newNode,
objRoot.childNodes.Item(1))
Else
newNode = objRoot.selectSingleNode("groupbydefault")
End If
newNode.Text = "1"
AddTrace("Created collapsed view of company")
myView.XML = objXML.XML

'Save and apply the new view.
myView.Save()
AddTrace("View saved")
myView.Apply()
'-------------------------------------------------------------------------------------------------------------------
This code is working fine on all of our machines (with clean machines
too). But on one of our client machine it is not working. If I print
myView.xml in the trace file then it is showing me perfect xml, but
view is not applied successfully.
My addin is VSTO addin for office 2003 in VB2005.

Thanks,
Dhananjay


  #4  
Old October 15th 07, 04:24 PM posted to microsoft.public.outlook.program_vba
Ken Slovak - [MVP - Outlook]
external usenet poster
 
Posts: 5,848
Default Custom view is not working

I have no idea why switching folders would work twice and not after that
unless something is being garbage collected or going out of scope.

If it works on one computer and not another there has to be something
different. Check for COM addins, use of synch software and PDA type devices,
other applications that are running at that time and anything else you can
think of.

--
Ken Slovak
[MVP - Outlook]
http://www.slovaktech.com
Author: Professional Programming Outlook 2007
Reminder Manager, Extended Reminders, Attachment Options
http://www.slovaktech.com/products.htm


"Dhananjay" wrote in message
ups.com...
Thanks Ken for your valuable reply,
And what's not working?

Ans: My view is not working. Custom property is added to folder
properties.
Now, as per Sue suggested, I selected different folder first & then
selected my custom folder again, it is showing me the currect view!!
So I changed the folder programmatically to inbox or contacts folder &
then switch back to my custom public folder. It works for 2 times &
after that, control remains in the Inbox folder, so I had to select my
custom folder again manually. Any ideas?

Other than that you're going to have to find out what's different about
your
machines and where it's not working.

Ans: I checked on "working" computer & "not working" computer for
environment, I found that
OS is same on both PCs (Windows XP)
SP of OS is same (SP 2)
All updates are fine for OS
Office 2003 SP3 is same on both PCs
User account rights are same on both PCs
What else I should check?
Thanks again,
Dhananjay


 




Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
custom form not working properly Eric32 Outlook - Installation 6 July 6th 07 02:16 PM
Custom Form not working on new term server Eric32 Outlook - Using Forms 3 July 6th 07 02:14 PM
Need help creating a custom view in appointment view Jack B. Pollack Outlook - General Queries 6 June 15th 07 04:48 PM
custom forms not working Annie Outlook - Using Forms 1 September 7th 06 11:01 PM
(Private View) in Custom View Organizer in OL 03 Bob S Outlook - General Queries 3 July 5th 06 12:34 AM


All times are GMT +1. The time now is 08:17 AM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.Search Engine Friendly URLs by vBSEO 2.4.0
Copyright ©2004-2025 Outlook Banter.
The comments are property of their posters.