473,387 Members | 1,904 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Word (Cindy!!)

KJM
Please tell me how we could write an array to a word table.

I am able to do it in excel at http://www.kjmsolutions.com/datasetarray.htm

Is there a comparable way you know in Word?
Nov 20 '05 #1
2 961
Hi Kjm,
Please tell me how we could write an array to a word table.

I am able to do it in excel at http://www.kjmsolutions.com/datasetarray.htm

Is there a comparable way you know in Word?

If I have an array, this is how I'd turn it into a table in a Word document
(the basics):
- Turn the array into a delimited string (using the VB Join function, for
example). The delimiter can be anything you like, just as long as it's a
character in the text. Or, you'd have to put the individual entries into
"quotes" so that it's clear where the character is NOT a delimiter.

- Assign this string to a RANGE in the Word document (rng.Text = s)

- convert the range (containing the delimited string) to a table (the
ConvertToTable method), assigning it to an object variable (Dim tbl as
Word.Table tbl = rng.ConvertToTable('set the params)

- Now use the tbl object variable to apply any required formatting to the
table

-- Cindy

Nov 20 '05 #2
Thanks Cindy.

I will start trying to pull this together.

"Cindy M -WordMVP-" <C.*********@hispeed.ch> wrote in message
news:VA.00009052.00c7d21d@speedy...
Hi Kjm,
Please tell me how we could write an array to a word table.

I am able to do it in excel at http://www.kjmsolutions.com/datasetarray.htm
Is there a comparable way you know in Word?
If I have an array, this is how I'd turn it into a table in a Word

document (the basics):
- Turn the array into a delimited string (using the VB Join function, for
example). The delimiter can be anything you like, just as long as it's a
character in the text. Or, you'd have to put the individual entries into
"quotes" so that it's clear where the character is NOT a delimiter.

- Assign this string to a RANGE in the Word document (rng.Text = s)

- convert the range (containing the delimited string) to a table (the
ConvertToTable method), assigning it to an object variable (Dim tbl as
Word.Table tbl = rng.ConvertToTable('set the params)

- Now use the tbl object variable to apply any required formatting to the
table

-- Cindy

Nov 20 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: steven chong | last post by:
Hi everyone, Hope the MVPs for Office can help me out here. Programming the word object is new to me. Basically, what i need to do is... 1) Open a template word document. 2) Menu->Insert->File...
2
by: sudha | last post by:
Hi I need to write a c# program which has to merge selected word documents into one word document. Kindly advise the efficient way to achieve this. Thanks in advance sudha
5
by: Picho | last post by:
Hi all, I have a problem automating word (office xp). I am trying to create a mailmerge datasource using this code: object oFieldsVector = (object)fieldsVector; object oFileName =...
8
by: Mike MacSween | last post by:
tblCourses one to many to tblEvents. A course may have an intro workshop (a type of event), a mid course workshop, a final exam. Or any combination. Or something different in the future. At...
5
by: Mattias Thuresson | last post by:
I have checkbox in a word document that I want to be able to check aand uncheck from my C#-app. How do I do that in a good way ? Regards. Mattias Thuresson
7
by: Tosch | last post by:
Has anyone ever tried to save a Excel document and a Word document in the same physical file? I have an application where there is always 1 Excel and 2 Word documents and 1 or 2 other files that...
3
by: John | last post by:
Hi How can I turn an sql string in my vb app into datasource for a word mailmerge? This example (below) tries to fill the data manually, a row at a time which is too time consuming and also user...
10
by: John | last post by:
Hi I am trying to do a word mailmerge form within my vb.net app. My problem is how to do a query on one of my tables and use the result as the mail merge datasource. Any help would be...
4
by: Bill Coan | last post by:
NOTE: This was posted earlier to vsnet.vstools.office under a different subject line but received no response. I'm having a problem automating Word's Find object from a .NET application, using...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.