Groups > WordPerfect Office > WordPerfect 12 > Re: Macro to open documents display positioning problem




Macro to open documents display positioning problem

Macro to open documents display positioning problem
Mon, 25 Feb 2008 08:01:24 -050
I have a macro that's been perplexing me, and can't understand what's 
not working right. The macro is below. It opens two documents, goes to 
the insertion point of the second one and returns to the first one. The 
problem is that when I switch back to the second document to start 
editing, although the cursor is in the right place, the document 
displays the first page. If I omit the "SwitchDoc (DocNum: 1)" at the

end and stay in document 2, the display is correct. The macro did (and 
still does) work as wanted in WP7, but I can't get it to work in WP12, 
despite trying to add different cursor movement and positioning commands 
within the macro. Any thoughts?

The macro:
OnCancel(Label: Quit)

FileOpen (Filename: "Doc 1 path and name")
PosLineDown ()
DisplayZoom (Percent: 90)

FileOpen (Filename: "Doc 2 path and name")
BookmarkFind (Name: "end")
PosWordPrevious ()
PosLineEnd ()
HardReturn ()
Tab ()
DateText ()

SwitchDoc (DocNum: 1)

Label(Quit) Quit
Post Reply
Re: Macro to open documents display positioning problem
Mon, 25 Feb 2008 09:21:10 -060
Try Display(On!) at the first of the macro.
Post Reply
Re: Macro to open documents display positioning problem
Mon, 25 Feb 2008 10:38:58 -050
That fixed it. Thanks, Kenneth.

David

Kenneth Hobson wrote:
> 
> Try Display(On!) at the first of the macro.
> 
Post Reply
Re: Macro to open documents display positioning problem
Mon, 25 Feb 2008 15:34:40 GMT
D381e:
> The macro is below.
>
Please find a slightly revised version below the sig.
It succeeds if WP has a document open when the macro is called.
You may wish to add a line -
vSecondDocNo = ?DocNumber
-- 
Good wishes!
Roy Lewis
C_Tech volunteer
(UK)

Application(wp;"WordPerfect";Default!)

OnCancel(Label: Quit)
DisplayZoom (Percent: 90)
vFirstDocNo = ?DocNumber

FileOpen (Filename: "Doc 1 path and name")
PosLineDown ()

FileOpen (Filename: "Doc 2 path and name")
OnError(NoBmk)
BookmarkFind (Name: "end")
PosWordPrevious ()
PosLineEnd ()
HardReturn ()
Tab ()
DateText ()

NoBmk:
OnError()
SwitchDoc (vFirstDocNo )

Label(Quit) Quit
Return


Post Reply
Re: Macro to open documents display positioning problem
Mon, 25 Feb 2008 16:12:21 -050
Thank you. I liked your suggestion, and it does help with the issue of 
another document being open when the macro is run. I made two changes to 
your revision:

I still needed the line that Kenneth suggested to solve the original 
problem:
Display(On!)

I moved the variable code you provided to run after the first document 
was opened, so that the first document opened by the macro becomes 
document 1. (I want to return to the document opened by the macro, and 
not another one that I may happen to have open.) So my macro looks like 
the revision at the bottom of this message.

David


lemoto wrote:
> D381e:
>> The macro is below.
>>
> Please find a slightly revised version below the sig.
> It succeeds if WP has a document open when the macro is called.
> You may wish to add a line -
> vSecondDocNo = ?DocNumber

Macro revised from your post:

Application(wp;"WordPerfect";Default!)
Display(On!)
OnCancel(Label: Quit)
DisplayZoom (Percent: 90)

FileOpen (Filename: "Doc 1 path and name")
PosLineDown ()
vFirstDocNo = ?DocNumber

FileOpen (Filename: "Doc 2 path and name")
OnError(NoBmk)
BookmarkFind (Name: "end")
PosWordPrevious ()
PosLineEnd ()
HardReturn ()
Tab ()
DateText ()

NoBmk:
OnError()
SwitchDoc (vFirstDocNo )

Label(Quit) Quit
Return


Post Reply
<< Previous 1 2 Next >>
( Page 1 of 2 )
about | contact