I am writing a document in the bookclass and want to have the name of the parts centered in the TOC. They should also be displayed without the part number and without page numbers. I have seen some solutions for other classes, but these do not seem to work. The code

\documentclass{book}
\usepackage{titlesec}
\makeatletter
\renewcommand*\l@part[2]{%
\ifnum \c@tocdepth >-2\relax
\setlength\@tempdima{3em}%
\begingroup
\parindent \z@ \rightskip \@pnumwidth
\parfillskip -\@pnumwidth
{\leavevmode
\hspace*{\fill}\centering\large\bfseries #1\hspace*{\fill}\llap{#2}}\par
\nobreak
\global\@nobreaktrue
\everypar{\global\@nobreakfalse\everypar{}}%
\endgroup
\fi}
\makeatother
\renewcommand{\partname}{}
\makeatletter
\titleformat{\part}[display]
{\Huge\scshape\filright\centering}
{}
{20pt}
{\thispagestyle{empty}}
\makeatother
\begin{document}
\tableofcontents
\part{This is a part of a document}
\end{document}


puts the part name centered, but how can I get rid of the numbers?

It is much simpler to do with titletoc than fiddling with a cryptic code:

\documentclass{book}
\usepackage[newparttoc]{titlesec}
\usepackage{titletoc} %

\titleformat{\part}[display]
{\Huge\scshape\filright\centering}
{}
{20pt}
{\thispagestyle{empty}}