No. of columns (newpaper)

K

Kushal

Can a macro be designed to know total no. of newspaper type columns? As if
there are 3 columns than answer must be three etc.
 
K

Kushal

How?
The code
ActiveDocument.Sections(n).PageSetup.TextColumns.Count
is not working
the code
ActiveDocument.PageSetup.TextColumns.Count
is working only on columns which start from begining of page. But if columns
start from in between then this code is not working.
So please give me proper code.
Thanks
--
Kushal



Jezebel said:
Yes it can.
 
J

Jezebel

No, you're too rude.


Kushal said:
How?
The code
ActiveDocument.Sections(n).PageSetup.TextColumns.Count
is not working
the code
ActiveDocument.PageSetup.TextColumns.Count
is working only on columns which start from begining of page. But if
columns
start from in between then this code is not working.
So please give me proper code.
Thanks
 
S

Stefan Blom

If column formatting changes in the middle of a page, there is also a
new section at that point. In other words, make sure that n refers to
the correct section!

A different approach, which may or may not be wise (depending on what
you are trying to accomplish) is to refer to the first section of the
current selection:

x = Selection.Sections(1).PageSetup.TextColumns.Count

ActiveDocument.PageSetup.TextColumns.Count would return 9999999
(wdUndefined) unless all sections have the same number of columns.

--
Stefan Blom
Microsoft Word MVP


in message
How?
The code
ActiveDocument.Sections(n).PageSetup.TextColumns.Count
is not working
the code
ActiveDocument.PageSetup.TextColumns.Count
is working only on columns which start from begining of page. But if columns
start from in between then this code is not working.
So please give me proper code.
Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top