Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

how to write value in a word table

how to write value in a word table

how to write value in a word table

I need to write a value (in red color) in the 2 tables of word doc?

I just have a code to open a doc with a visible option.

part of cdoe:


Dim APP As Object
Dim DOC As Object
Set APP = CreateObject("WORD.Application")
APP.Visible = True

Set DOC = APP.documents.Open("C:\Lavori_Vb6\HOTEL\Fattura.doc")



RE: how to write value in a word table

I usually place a Bookmark in my document where I want to place my text and do:

DOC.Bookmarks("bkmMyBookMark").Range.Text = "Any text I want"

---- Andy

"Hmm...they have the internet on computers now"--Homer Simpson

RE: how to write value in a word table

What is the source of the data that you are using to fill in the doc?

database? VB Array? Set of variables?

RE: how to write value in a word table

If not using bookmarks, putting text in a specific cell of a table would be something like this:
worddoc.Tables(1).cell(1, 1).Range.text = "Any text " & stVariableText

Above is an example of combining hard coded text with variable text, if doing variables, remove hard coded text.

Cells are from left to right starting at 1. Looks like you may have two tables? If so, would need to identify the table number for each. So BANCA X - Via would be .cell(4,2) for the 4th row and 2nd col.

RE: how to write value in a word table

FOR strongm,
Set of variables

RE: how to write value in a word table

Then Andy's bookmark solution is probably your best bet. Have you tried it?

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close