Using D2009, WP 6.01. When I use the built in action I get the current page, not the page count. What am I doing wrong?
WPDefaultActions1.WPDefAct.WPAInsertPageCount.Execute;
Using D2009, WP 6.01. When I use the built in action I get the current page, not the page count. What am I doing wrong?
WPDefaultActions1.WPDefAct.WPAInsertPageCount.Execute;
Unfortunately I don't have an answer to your exact problem but I thought I would share something that works for us (granted my Delphi version is 6 and I am using the latest WPTools - 6.0😎
Instead of using the action to retrieve the pagecount, I use the PageCount property of the editor itself. Works like a charm for us.
Hi,
Yes, it is better to access the methods directly.
Fields to display the pagecount, date etc can be inserted with InputTextField
function InputTextField(typ: TWPTextFieldType; FieldMask: string = ''): TWPTextObj;
TWPTextFieldType =
(wpoPageNumber,
wpoNextPage,
wpoPriorPage,
wpoNumPages,
wpoDate,
wpoTime,
wpoSectionNumPages
);
Julian
The stupid question: Why can't the action do the same as the suggested workaround? Wouldn't that fix what someone would call a bug?
The actions always work with "the current" editor. If there is no current editor it won't do anything. So the action is somewhat different the direct access of an objects interface. I see no bug here.
Julian