The idea of an Office Convention was first discussed in a bar that has never been mentioned on the show, though its name would seem to make it a shoo-in: the Banshee. Among a small group of local professionals meeting for drinks this year was Michele Dempsey, a 35-year-old architect who had left for 12 years and returned in 2003 to start her own firm. A fan of the BBC show, she reveled in the American version’s references to her city.

“Scranton has shown up in things,” Ms. Dempsey said. “But it’s never been in a nice light. And that’s been upsetting.” She can list slights and jokes at her city’s expense in shows like “All in the Family” and “The Simpsons” (which happens to be among Mr. Daniels’s credits). The at-worst-gentle teasing in “The Office” allowed residents like her the refreshing change of being in on the Scranton joke.

The mayor and others say that their city is in the midst of an economic and cultural revival, and that “The Office” was, in Ms. Dempsey’s words, an “X factor” in that comeback. She had seen the throngs who showed up at the mall in December for a paid appearance by Rainn Wilson, an “Office” star. “They were lining up at 4 in the morning,” she said. “And I thought, if they do that for one cast member, what would happen if we brought in a bunch?”

That began months of planning and negotiating and pleading with cast members to sign on. Mayor Doherty and other residents taped a music video inviting every actor and even some producers by name.

The organizers say they would have held the convention even if nobody agreed to appear. But this month commitments came from most of the cast, including Mindy Kaling (who plays Kelly) — for fees the organizers would not reveal, though they report a budget approaching $250,000. (Steve Carell, Jenna Fischer, Mr. Krasinski and Mr. Wilson, who all play leading characters, have not signed on.)

Fan response has been positive so far, with brisk ticket sales and solidly booked downtown hotels.

Conventiongoers can compete in an Office Olympics like the one in Season 2 when the Dunder Mifflin workers raced in paper-box snowshoes; see a panel discussion with the cast; and hear the Scrantones, whose members wrote the theme song. Mr. Daniels will be making his first trip to the city and said his writers would drive around the area looking for story ideas.

In Slough there may be a sense of missed opportunity. Officials there had always issued curt statements about “The Office,” said Gemma Morgan, marketing and communications manager for the borough council. “But at the end of the day the show put us on the map.”