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 / Mailmerge and Fax / November 2006

Tip: Looking for answers? Try searching our database.

Preserve table format after InsertDatabase method?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Barry - 08 Nov 2006 16:24 GMT
>From VB6, I'm calling the InsertDatabase method on a Word doc to insert
an Access table into a Word table. When I do this directly in Word, I
can use \* mergeformat to prevent Word from changing my table's format.
However, I cannot figure out how to prevent this auto-formatting from
overriding my pre-set table formats when I do it in code.

I've also tried programmatically restoring my column widths, etc. after
the InsertDatabase call, but I get an error saying "The SetWidth method
or property is not available because some or all of the object does not
refer to a table".

Any help would be appreciated.

Barry
Peter Jamieson - 08 Nov 2006 21:10 GMT
Unless you are using the built-in table formats and options (which you can
specify in the InsertDatabase method call, I haven't checked but I think you
will need to do

ActiveDocument.InsertDatabase ....
Selection.Tables(1).Select
or perhaps
Dim rngTable As Range
Set rngTable = Selection.Tables(1).Range
With rngTable
' do your stuff
End With

Peter Jamieson
> >From VB6, I'm calling the InsertDatabase method on a Word doc to insert
> an Access table into a Word table. When I do this directly in Word, I
[quoted text clipped - 10 lines]
>
> Barry
 
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.