Simon McInnes was telling us:
Simon McInnes nous racontait que :
> Hi,
>
[quoted text clipped - 14 lines]
> Insert a column break and move the insertion point to the second
> column Find out the current column number using the api
Word does not work like that.
You may be in a two column mode, but Word sees it as a continuous story
(when you get to the end of the column, go the top of the next one..
Your best bet is probably to get the paragraph starting position in relation
to the left margin...

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org
Simon McInnes - 26 Oct 2006 09:19 GMT
Thanks for your reply. I have found a way but its not great.
You can use the Word Dialogs -
Application.Dialogs(wdDialogFormatColumns).ColumnNo property. This is a real
pain in C# but its do-able. Using dialogs has its drawbacks like not working
on protected parts of the document but its better than nothing. Its a shame
its not available through the Range.Information property but hey thats just
another Word annoyance we have to live with!
Simon
> Simon McInnes was telling us:
> Simon McInnes nous racontait que :
[quoted text clipped - 24 lines]
> Your best bet is probably to get the paragraph starting position in relation
> to the left margin...
Jean-Guy Marcil - 26 Oct 2006 13:40 GMT
Simon McInnes was telling us:
Simon McInnes nous racontait que :
> Thanks for your reply. I have found a way but its not great.
>
[quoted text clipped - 5 lines]
> Range.Information property but hey thats just another Word annoyance
> we have to live with!
Good one.
If you find that working with dialogs is too much of a pain, try something
like:
If Format(PointsToInches(Selection.Range.Paragraphs(1) _
.Range.Information(wdHorizontalPositionRelativeToPage)), "#.#0") _
> Format(PointsToInches(Selection.Sections(1).PageSetup _
.LeftMargin), "#.#0") Then
MsgBox "You are in the second column."
Else
MsgBox "You are in the first column."
End If
Of course, you will have to adapt if you have more than 2 columns...

Signature
Salut!
_______________________________________
Jean-Guy Marcil - Word MVP
jmarcilREMOVE@CAPSsympatico.caTHISTOO
Word MVP site: http://www.word.mvps.org