PChangeAll

Replaces all occurrences of the specified text in the selected range, the active story, or all stories of the current publication.


Command constructor

PChangeAll(const char * sFindWhat, const char *sChangeTo, short cSearchRange, PMBool bMatchCase, PMBool bWholeWord, PMBool bClearAttr);
const char * sFindWhat;
Text to search for.
const char * sChangeTo;
Replacement text.
short cSearchRange;
kFCSSelectedText to search selected text
kFCSCurrentStory to search current story only, starting from position of insertion point (default setting)
kFCSAllStories to search all stories in current publication, starting from beginning of currently active story
kParmDefault to use default or previously defined range
kParmDontCare to let system choose a range based on the current text selection. If text is selected, PChangeAll searches only selected text; if no text is selected, PChangeAll searches current story only, starting from position of insertion point.
PMBool bMatchCase;
false to turn off case-sensitive searching (default setting)
true to turn on case-sensitive searching (match capitalization of search text exactly)
PMBool bWholeWord;
false to search for any occurrence of specified text (default setting), even if the text is found within another word (for example, searching for "story" could yield "history,"as well as "story")
true to search for specified text as a whole word only, disregarding cases where text is embedded within another word
PMBool bClearAttr;
false to use existing text and paragraph attriute settings (default setting)
true to clear attribute settings (both Find and Change settings)
Story editor only. The PChangeAll command works only in story editor.

Current publication only. Unlike the Change All button in the Change dialog box, the PChangeAll command cannot search multiple publications. PChangeAll can search only the stories in the currently active publication.

Setting text and paragraph attributes. To search for and replace text and paragraph attributes (e.g., font, type size, paragraph style), use the PFindTypeAttr1, PFindTypeAttr2, PFindParaAttr, PChangeTypeAttr1, PChangeTypeAttr2, and PChangeParaAttr commands, followed by the PChangeAll command with bClearAttr set to useattributes or 0.

Changing only text attributes. To change text attributes only (e.g., all 10 point, bold text to 9-point, Helvetica bold), first use the PFindTypeAttr1, PFindTypeAttr2, PChangeTypeAttr1, and PChangeTypeAttr2 commands to set the desired attributes. (Be sure to clear the paragraph attributes with the PFindParaAttr and PChangeParaAttr commands.) Then, using the PChange command, specify an empty string for both sFindWhat and sChangeTo and set bClearAttr to useattributes or 0.

Searching for and changing special characters. You enter a special character as part of your search or replacement text using the same key combinations that you type to enter the character directly into the Change dialog box. Refer to Adobe PageMaker 6.5 Help > Shortcuts > Special Characters.

Exceptions. There are two common situations which will result in an exception being thrown by the constructor:

Example. The following example selects a story, inserts the insertion point into the story, and switches to story editor. It then replaces all instances of the word "rumba," regardless of the capitalization or attribute settings, with "cha-cha." It searches only the currently active story.

PSelect(1); // select story
PTextEdit();
// insert insertion point into beginning of selected story
PEditStory();
// switch to story editor
PChangeAll("rumba", "cha-cha", true, false, true, true);


See also

The PChange, PChangeParaAttr, PChangeTypeAttr1, PChangeTypeAttr2, PChangeWindow, PFind, PFindNext, PFindParaAttr, PFindTypeAttr1, PFindTypeAttr2, and PFindWindow commands

The PGetChangeParaAttr, PGetChangeTypeAttr1, PGetChangeTypeAttr2, PGetChangeWindow, PGetFindParaAttr, PGetFindTypeAttr1, PGetFindTypeAttr2, and PGetFindWindow queries

Adobe PageMaker 6.5 Help > Commands > Utilities > Change

Adobe PageMaker 6.5 Help > Shortcuts > Special Characters


Copyright © 1996, Adobe Systems Incorporated. All rights reserved.

Comments or suggestions? Contact Adobe Developer Support