Multiple columns

I

Ivan Debono

Hi all,

I've got a template with autotextentries and bookmarks set up and use it to
create documents with VB6. Records are read from a database and then
inserted into a document based on the template. It works fine.

But I would like to insert data in multiple columns. Currently I manage to
do:

Item Cost
A $5
B $8
C $9

But I would like:

Item Cost Item Cost
A $5 B $8
C $9

Is it possible to automate it?

Thanks,
Ivan
 
K

Klaus Linke

[...] Item Cost
A $5
B $8
C $9

But I would like:

Item Cost Item Cost
A $5 B $8
C $9

Is it possible to automate it?


Hi Ivan,

Not quite.

But you could
-- adjust the table width so it fits in less than half the page width,
-- create a section with two columns (add continuous section breaks above
and below the table, go into the table, "Format > Colums > Two)
-- and set the heading row to repeat (select the row with "Item cost", menu
"Table > Heading rows repeat").

You'd get
Item Cost Item Cost
A $5 C $9
B $8

Greetings,
Klaus
 
I

Ivan Debono

Thanks. Works great!

Klaus Linke said:
[...] Item Cost
A $5
B $8
C $9

But I would like:

Item Cost Item Cost
A $5 B $8
C $9

Is it possible to automate it?


Hi Ivan,

Not quite.

But you could
-- adjust the table width so it fits in less than half the page width,
-- create a section with two columns (add continuous section breaks above
and below the table, go into the table, "Format > Colums > Two)
-- and set the heading row to repeat (select the row with "Item cost", menu
"Table > Heading rows repeat").

You'd get
Item Cost Item Cost
A $5 C $9
B $8

Greetings,
Klaus
 
I

Ivan Debono

When I use this code:

Set oAuto =
oWrd.Templates(Template).AutoTextEntries("SectionDetails")
If Not oAuto Is Nothing Then
With .Characters.Last
.Collapse wdCollapseEnd
.Text = oAuto.Name
.InsertAutoText
.Bookmarks("ItemName").Range.Text =
oRST.Fields("ItemName")
End With
Set oAuto = Nothing
End If

I get an error: 'The Range could not be deleted'

Any ideas?

Ivan


Klaus Linke said:
[...] Item Cost
A $5
B $8
C $9

But I would like:

Item Cost Item Cost
A $5 B $8
C $9

Is it possible to automate it?


Hi Ivan,

Not quite.

But you could
-- adjust the table width so it fits in less than half the page width,
-- create a section with two columns (add continuous section breaks above
and below the table, go into the table, "Format > Colums > Two)
-- and set the heading row to repeat (select the row with "Item cost", menu
"Table > Heading rows repeat").

You'd get
Item Cost Item Cost
A $5 C $9
B $8

Greetings,
Klaus
 
K

Klaus Linke

Hi Ivan,

Might be a problem with your "With"s:
Do you really want .Characters.Last.Bookmarks("ItemName").Range.Text?
You'll probably get an error if the last character (of whatever it is
you're
looking at) isn't in the bookmark "ItemName".

oRST.Fields("ItemName") also looks funny to me. Is this supposed to be some
field in the bookmark "ItemName"? And what is setting some text to a field
supposed to do?

In case you can't figure the problem out, best start a new thread, and tell
in which line do you get the error, and what the code is supposed to do.

Good luck,
Klaus




----- Original Message -----
From: "Ivan Debono" <[email protected]>
Newsgroups: microsoft.public.word.vba.general
Sent: Tuesday, June 15, 2004 10:38 AM
Subject: Re: Multiple columns
 

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