Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
Home
DiscussionsAccessExcelInfoPathOutlookPowerPointPublisherWord
DirectoryUser Groups
Related Topics
Outlook ExpressInternet ExplorerWindowsMS Server ProductsMore Topics ...

MS Office Forum / Word / Programming / September 2007

Tip: Looking for answers? Try searching our database.

complex table manipulation via VBA (in ms access)

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Keith G Hicks - 20 Sep 2007 18:04 GMT
I moved this post here from the docmanagement newsgroup as it makes more
sense in this one.

I am trying to populate a table (word 2003) via automation in ms access.

My template word file is set up with a table as follows (sorry, I cannot get
all this to not wrap funny so my samples may not be as clean looking as I'd
like):
---------------------------------------------------------------------
| Customer / |   Address                |      Values                |
Phone/     |
| Cust #        |                                |
|  Fax         |
---------------------------------------------------------------------
| FormField  |                                |  Bldg:    FormField   |
|
|                   |    FormField            |  Autos:  FormField   |
FormField|
-------------|                                |  Land:   FormField   |
FormField|
| FormField  |                                |  Mach.: FormField   |
|
|                   |                                |
|                 |
---------------------------------------------------------------------

At the moment I have non bookmark bound form fields indicated above by
"FormField"

I need to end up with something similar to what's shown below. The number of
"rows" of course depends on how many customer records there are.

----------------------------------------------------------------------------
--------------
|    Customer /   |        Address                 |                Values
|        Phone/    |
|    Cust #          |                                      |
|        Fax         |
----------------------------------------------------------------------------
--------------
|      George      |                                       |  Building:
$500,000           |  213-6541     |
|                       |   123 Main                     |  Autos:      $
78,000           |                       |
----------------|  Suite 1                          |  Land:        $125,000
|  213-6544      |
|          12         |   Elmville, MO 50121     |  Machines: $750,000
|                      |
|                       |                                       |
|                       |
----------------------------------------------------------------------------
--------------
|      Harry        |                                       |  Building:
$450,000           | 477-7500      |
|                       |   75 Elm                         |  Autos:
$241,000           |                       |
----------------|  Berkley, CA 91323      |  Land:        $ 90,000
|  none              |
|          15         |                                       |  Machines:
$621,000           |                      |
|                       |                                       |
|                       |
----------------------------------------------------------------------------
--------------

So I not only need to get the correct data into each form field but I also
need to "append" a new properly laid out set of rows to the table for the
next record(s). I have no way of knowing in advance how many records there
will be and I cannot have blank rows.

Can anyone suggest a good way to handle this? In the past, I've done this
without tables and just set up tab positions. I'd place a single bookmark at
the start of the data and then tab to each column (but no table remember)
and then do a CR at the end of the line. This has always worked fine but my
client wants  a fancier layout than that.

In addition, they want this to be a "form" (which is why I need the form
fields) so that end users can only edit the data in the form fields. I know
I need to programatically turn off protection when creating the doc in code
but then I turn it back on once the doc has been created.
Thanks in advance,

Keith
Keith G Hicks - 20 Sep 2007 20:35 GMT
Never mind. I'm handling this differently.

> I moved this post here from the docmanagement newsgroup as it makes more
> sense in this one.
[quoted text clipped - 79 lines]
>
> Keith
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.