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 / June 2005

Tip: Looking for answers? Try searching our database.

word - vba - template and table

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Daniel - 10 Jun 2005 18:08 GMT
My user gave me a word doc that has tables and texts inside the tables.
Instead of building it from scratch using vba, can I save it into template
and read it in using vba and change some fonts and text contents?

Thanks
Daniel
Shauna Kelly - 11 Jun 2005 03:56 GMT
Hi Daniel

There are two options.

First way: open the document. File > Save As. In the "Save as Type" box,
choose Word Template. The advantage of this way is that it is incredibly
simple and takes no time at all. The disadvantage is that it will bring into
the template any "baggage" in the document, such as unused list templates,
potentially corrupt tables etc.

Second way: File > New and choose to create a new Template. Copy all
*except* the last paragraph mark from the document and paste the content
into the new template. The advantage of doing it this way is that you are at
least starting off with a clean template, generated from within the Word
.exe file.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> My user gave me a word doc that has tables and texts inside the tables.
> Instead of building it from scratch using vba, can I save it into template
> and read it in using vba and change some fonts and text contents?
>
> Thanks
> Daniel
Daniel - 12 Jun 2005 01:01 GMT
How can I refer to the cells in each already existing table and modify the
text in some of the cells in different table? If there are table possible
within a table, is there a way to find it out and if it is, how can I refer
the cell within a table within another table cell?

Thanks
Daniel

> Hi Daniel
>
[quoted text clipped - 23 lines]
> > Thanks
> > Daniel
Shauna Kelly - 12 Jun 2005 07:00 GMT
Hi Daniel

Generally, you can use something like Selection.Tables(1).NestingLevel to
return the "depth" of the nested tables.

There's some code at
http://groups-beta.google.com/group/microsoft.public.word.tables/browse_frm/thre
ad/5426a6abb6e34032/56afcae3c3c7ccd0

that shows how to move up through the nest to the top level table.

Hope this helps.

Shauna Kelly.  Microsoft MVP.
http://www.shaunakelly.com/word

> How can I refer to the cells in each already existing table and modify the
> text in some of the cells in different table? If there are table possible
[quoted text clipped - 36 lines]
>> > Thanks
>> > Daniel
Daniel - 12 Jun 2005 13:47 GMT
Thanks for your reply. My user gave me a word doc that has nested table. Is
there a way to find manually certain cell number in a nested table and use it
in vba to replace certain text within that cell programmatically? I am using
vb 6 in visual studio 6 and word 2000.

Thanks
Daniel

> How can I refer to the cells in each already existing table and modify the
> text in some of the cells in different table? If there are table possible
[quoted text clipped - 31 lines]
> > > Thanks
> > > Daniel
 
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.