Vba and filling column

J

JimS

I am having a problem with a Word doc. I want to print records into a
document. I would like the document to have two columns. If the record is
an even number put the text in the first column and if its an odd number
print the text in the second column. I will then insert a text box (?) to
give a small paragraph 'disclaimer' that would be printed at the bottom of
the page. I seem to be able to print down one side of the page but I think
the column object isnt there. I cant get it to print in the second column.
Does any one hae any ideas or a small example? This is my first Word doc
but I mostly work in Excel and dont have this kind of issue with the objects

Thanks a bunch!
 
D

Doug Robbins

You probably should be inserting the data into the cells of a two column
table. Easier to give you some specific advice if you post back to the
newsgroup with the code that you are now using.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
J

JimS

Hello Doug
I have included the code that I am using to print. This prints the correct
information. I just need to figure out how to get it to print in one column
and then in another column. Would I be better off trying to name a range
and then printing into that range?

Thanks so much for any bit of help!

Do While Not adoRS.EOF
' print name, last name, city and state for this record into the
document inlcuding new line and font change between lines.
Selection.TypeParagraph
Selection.Font.Name = "Arial Bold"
Selection.TypeText RTrim(adoRS!FIRST_NAME) & " " &
RTrim(adoRS!LAST_NAME)
Selection.TypeText " "
Selection.TypeParagraph

Selection.Font.Name = "Tahoma"
Selection.TypeText RTrim(adoRS!CITY) & ", " & RTrim(adoRS!State)
' A blank line.
' space between each record
Selection.TypeParagraph

' Move to the next record in the recordset.
adoRS.MoveNext
Loop


You probably should be inserting the data into the cells of a two column
table. Easier to give you some specific advice if you post back to the
newsgroup with the code that you are now using.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

Doug Robbins

Have you considered using a label or catalog type mailmerge for this? You
can use the Charformat switch on the applicable mergefields to get the font
changes that you want. It's a lot easier than re-inventing the wheel.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

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