Results 1 to 3 of 3
  1. #1
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    any code to obtain the current column (w97 sr2b)

    hiya -
    i have a template formatted with 2 columns - with different widths. when text is inserted into the 2nd column, the text has to have different formatting applyed.
    I use code to insert text into the document.
    Does VBA code exist to obtain the current column within a document?
    I've had a look & couldnt find anything for .TextColumn?
    many thanks Diana

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: any code to obtain the current column (w97 sr2b)

    Diana,

    Dialogs(wdDialogFormatColumns).ColumnNo

    will return the column number of the current selection - if the current selection contains more than one column, it will return the column number of the first column in the selection. I got this from How to get the column number of the selection (in a document containing snaking, or newspaper-style, columns) on the very useful Word MVP site.

  3. #3
    Bronze Lounger
    Join Date
    Jan 2001
    Location
    Melbourne, Australia
    Posts
    1,294
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: any code to obtain the current column (w97 sr2b)

    Hey Hans

    I used the following:

    Dim x As Long
    x = Dialogs(wdDialogFormatColumns).ColumnNo

    & that worked a treat!
    Thankyou Diana

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •