Re: Column Select Mode
From: Mike Petrie (mike_at_petrie.u-net.com)
Date: 05/07/04
- Next message: Robin Tucker: "Manipulate text in a "copied" area?"
- Previous message: siddartha: "RE: Using Find/Replace in Headers"
- In reply to: Klaus Linke: "Re: Column Select Mode"
- Messages sorted by: [ date ] [ thread ]
Date: Fri, 7 May 2004 11:47:23 +0100
Thanks Doug & Klaus,
Two variations to play with. I'll have a go at getting this working over the
weekend - back again after that.
Thanks
Mike
"Klaus Linke" <info@fotosatz-kaufmann.de.no.junk> wrote in message
news:u9DipV8MEHA.3420@TK2MSFTNGP11.phx.gbl...
> Hi Mike,
>
> I ran into that bug too.
>
> Running a macro always turns off the column select mode.
> And if you turn on the column select mode in a macro, it gets turned off
> again when the macro finishes.
>
> There doesn't seem to be anything you can do about it :-(
>
> If you have selected some block in your macro, and your macro has stopped,
> the user will have to use Ctrl+Shift+F8 again to turn the mode on again,
> and to make changes to the selected block.
>
> If you have some start and end points (rng.Start, rng.End, given by the
> current Selection in the macro below) and want to select the "block", you
> could use something like
> Dim rng As Range
> Dim iStartLine As Long
> Dim iEndLine As Long
> Dim iStartCol As Long
> Dim iEndCol As Long
> Set rng = Selection.Range.Duplicate
> iStartLine = rng.Information(wdFirstCharacterLineNumber)
> iStartCol = rng.Information(wdFirstCharacterColumnNumber)
> Selection.Collapse (wdCollapseEnd)
> iEndLine = Selection.Information(wdFirstCharacterLineNumber)
> iEndCol = Selection.Information(wdFirstCharacterColumnNumber)
> rng.Select
> Selection.Collapse (wdCollapseStart)
> Selection.ColumnSelectMode = True
> Selection.MoveLeft Unit:=wdCharacter, Count:=iStartCol
> Selection.MoveDown Unit:=wdLine, Count:=(iEndLine - iStartLine)
> Selection.MoveRight Unit:=wdCharacter, Count:=iEndCol - 1
>
> As said above, the user would have to click Ctrl+Shift+F8 again to change
> the block.
>
> Regards,
> Klaus
>
>
> "Mike Petrie" <mike@petrie.u-net.com> wrote:
> > I'm trying to get a column select mode type effect. I can use
> CTRL+SHIFT+F8
> > and the cursor keys or mouse to get a selection and copy that to the
> > clipboard, for instance. However, if I create a macro to turn the mode
on
> > and then leave the user to mouse around it doesn't work - the mode is
> > deselected (or never gets selected?) I used the code from the Macro
> Recorder
> > as a basis - it looks like this:
> >
> > Sub ColSelMode()
> > '
> > If Selection.ColumnSelectMode = False Then
> > Selection.ColumnSelectMode = True
> > Else
> > Selection.ColumnSelectMode = False
> > Selection.End = Selection.Start
> > End If
> >
> > End Sub
> >
> > If I have some cursor navigation commands following the End If, it's
> fine!
> > Any ideas?
> >
> >
> > The second and related problem is that I use a couple of bookmarks to
> > delimit a range in the document. This is fine for a normal selection,
but
> > I'd like to be able to use the same two markers to delimit the NE/SW
> corners
> > of a column selection block. Unfortunately the colomn select mode
doesn't
> > support ranges (or should that be the other way around), and also,
> > navigation seems to be limited to cursor up/down a line and L/R a
> character,
> > you don't seem to be able to jump to a point. I'd like to be able to go
> to
> > the first bookmark, turn on column mode, jump to the second one, and
then
> > run any of a series of other commands based on what the user has typed -
> > copy, paste, move, delete, write to file, etc. Does anyone know of a
work
> > around for such a scenario.
> >
> >
> > Thanks!
> > Mike
> >
> >
>
>
- Next message: Robin Tucker: "Manipulate text in a "copied" area?"
- Previous message: siddartha: "RE: Using Find/Replace in Headers"
- In reply to: Klaus Linke: "Re: Column Select Mode"
- Messages sorted by: [ date ] [ thread ]
Relevant Pages
|