Extract Task Filter Properties

M

Matthew McDermott

Has anyone been successful extracting the properties of a filter in VBA?

For example, I can create a new filter like this:
FilterEdit Name:="Filter 1", TaskFilter:=True, Create:=True,
OverwriteExisting:=True, FieldName:="% Complete", Test:="equals",
Value:="100", ShowInMenu:=False, ShowSummaryTasks:=False

But how can I test the current filter to determine what FieldName, Test, or
Value is being used?

As far as I can tell, these attributes are not exposed for the filter.
 
M

Mark Durrenberger

Not sure this is possible. Why is it that you want this info?

Thanks
Mark

--
_________________________________________________________
Mark Durrenberger, PMP
Principal, Oak Associates, Inc, www.oakinc.com
"Advancing the Theory and Practice of Project Management"
________________________________________________________

The nicest thing about NOT planning is that failure
comes as a complete surprise and is not preceded by
a period of worry and depression.

- Sir John Harvey-Jones
 
M

Matthew McDermott

I am working on a process that requires me to detect the filter properties
like fieldname, test and value. It will enable the user to manipulate
filters in a new way.

It does not make sense that I can set a filter and not detect it's
properties.

Matthew
 
J

Jan De Messemaeker

Hi,

Sense or nonsense, that is how it is I'm afraid.
Same goes for other objects like tables and views
HTH
 
J

John

Matthew,
Jan is right of course. What may or may not make sense to you is not
necessarily the common viewpoint. My basic response is that if a filter
is being set up in VBA then the person writing the code must already
know the filter properties or how else did he/she set it up.

However, I don't like a flat "no" answer - there is generally always
some method of getting what you want, it just takes clever, sometimes
out-of-the-box type thinking. What exactly are you trying to do. Perhaps
we can help come up with a solution.

John
 
M

Matthew McDermott

Thanks John,

Essentially I am working on a process that requires me to detect the filter
properties
like fieldname, test and value. It will enable the user to manipulate
filters in a new way. These are usually filters that the user set up in the
filters dialog, not in VBA.....so I don't have access to the filters.

Regardless of what I am doing with the values, I'd like to figure out a way
to find out the current values of fieldname, test and value for the current
active filter.

Thanks again for the help!

Matthew
 
J

John

Matthew,
Well, since the filter properties you are after are not available
directly in VBA, an alternate method of getting to your end goal is
needed but you don't specify what the end goal is other than
"manipulating filters in a new way". What does that mean? And if there
is some chance of helping you, we DO need to know what you want to do
with the filter properties. Otherwise, we can think outside-of-the-box.

John
 
M

Matthew McDermott

John,

Thanks, the simple answer is I want to write the filter values out to an XML
file.

I have written a routine that reads the values in from XML and applies the
filter and now I would like to detect the values of the current filter and
write them out to XML.

M
 
J

John

Matthew,
I'm not familiar with XML but no matter. The problem you face is indeed
challenging. Since the filter values are not available directly, I would
look at the possibility of developing an algorithm that through a
process of elimination can deduce what the filter values must be. Not
easy for sure but my experience tells me that given some time and a good
portion of clever thinking, it can be done. Now the question becomes, is
it worth it for you or someone else to invest the necessary resources to
solving this problem.

This probably isn't much help to you although I personally enjoy a good
challenge like this.

John
 

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