Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Mailmerge and Fax / December 2007

Tip: Looking for answers? Try searching our database.

Word 2003, How to Save Filters Permanently?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Kate - 10 Dec 2007 17:11 GMT
I use Word 2003 to produce a report with Mailmerge, I set up filters for the
specific data in the complex database. If I’ll keep same datasource for next
report, but some changes have been made in the database, all advanced filter
that were set up will disappear and I need to set up all filters all over
again. Is there a way to keep filters permanently?
Signature

Thanks,
Kate

Peter Jamieson - 12 Dec 2007 10:19 GMT
What type of data source are you using, and which facilities in Word are you
using to filter? (Word does different things depending on whether you e.g.
select specfic records using their checkboxes in Mailmerge Recipients, or
using the drop-downs in the column headers in that dialog, or using the
Query Options dialog)

> but some changes have been made in the database, all advanced filter

Are these structural changes (e.g. someone has added columns) or changes to
the database content (e.g. someone has added/deleted rows?

There are general problems in this area and there may be an error in Word
that will lose your sorts/filters however you set them up, but if that is
the case, then what I had in mind was that once you set up the sorts/filters
you want, you use a bit of VBA to save the SQL query that Word constructs
from your specifications, and when you re-open the document, you use another
bit of VBA to re-instate that query. Not very nice, but I think it is at
least feasible, as long as you are allowed to run VBA macros (and
preferably, as long as you are the only user). But if you are selecting
individual records in the MailMerge Recipients, Word does not modify the SQL
query's WHERE clause - it just stores a list of selected records - so that
approach would not be enough.

Signature

Peter Jamieson
http://tips.pjmsn.me.uk

>I use Word 2003 to produce a report with Mailmerge, I set up filters for
>the
[quoted text clipped - 4 lines]
> that were set up will disappear and I need to set up all filters all over
> again. Is there a way to keep filters permanently?
Kate - 12 Dec 2007 14:32 GMT
Dear Peter,
Thank you very much for your detailed response, truly appreciate that!
Can I ask you for another advice?

With Mailmerge Report production (Word 2003), and using Excel spreadsheet as
a data source, in the option for filters, when I click on the column and use
drop down menu with selection of Advanced - Filter Records, I can see my
filters option in blue and can add or modify my filter options.

I would set up few filters, after that if I made some changes in database
(not the columns or rows, but just different content). With next report
filters are still in place but as a default, my spreadsheet still filtered,
but I don’t see my selections in Advanced Filter options.

Am I doing something incorrectly or this is the case with filters in this
situation? Can I set up filters the way that I’ll be able to see my filtering
options?

Thanks again,

Signature

Thanks,
Kate

> What type of data source are you using, and which facilities in Word are you
> using to filter? (Word does different things depending on whether you e.g.
[quoted text clipped - 27 lines]
> > that were set up will disappear and I need to set up all filters all over
> > again. Is there a way to keep filters permanently?
Peter Jamieson - 12 Dec 2007 16:32 GMT
OK, on a really simple example here, everything works OK. But you do have to
save the Mail Merge Main document, because that is where the filters are
stored. (And you can only insert so many filters.)

If you can open up the VBA Editor, open the immediate window and type

print activedocument.mailmerge.datasource.querystring

(then enter)

you should see the query that Word last built from your query options, e.g.

SELECT * FROM `Sheet1$`  WHERE `t` = 'text4' And `d` = #10/25/2007#

If you save that somewhere - e.g. in a Notepad document, if you lose the
filter when you re-open the Word document then you should be able to use

activedocument.mailmerge.datasource.querystring = "SELECT * FROM `Sheet1$`
WHERE `t` = 'text4' And `d` = #10/25/2007#"

to set the filters back again. (If there are any double-quote characters in
the query, you have to double them up).

Signature

Peter Jamieson
http://tips.pjmsn.me.uk

> Dear Peter,
> Thank you very much for your detailed response, truly appreciate that!
[quoted text clipped - 59 lines]
>> > over
>> > again. Is there a way to keep filters permanently?
Kate - 12 Dec 2007 17:28 GMT
Thanks for your prompt response,
Signature

Thanks,
Kate

> I use Word 2003 to produce a report with Mailmerge, I set up filters for the
> specific data in the complex database. If I’ll keep same datasource for next
> report, but some changes have been made in the database, all advanced filter
> that were set up will disappear and I need to set up all filters all over
> again. Is there a way to keep filters permanently?
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.