Reply
 
Thread Tools Display Modes
  #1   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Barry Barry is offline
external usenet poster
 
Posts: 1
Default Preserve table format after InsertDatabase method?

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

  #2   Report Post  
Posted to microsoft.public.word.mailmerge.fields
Peter Jamieson Peter Jamieson is offline
external usenet poster
 
Posts: 4,582
Default Preserve table format after InsertDatabase method?

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
"Barry" wrote in message
ups.com...
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



Reply
Thread Tools
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Table of contents numbering not consistent with page numbering format srd Tables 1 July 9th 06 07:49 PM
Table format problems TBoe Tables 3 June 8th 06 07:09 PM
Table headers/footers and layout Keith Page Layout 1 April 8th 05 07:37 PM
How to Avoid Word 2003 Table Style Problems Judy Haynes Tables 0 March 23rd 05 06:41 PM
Getting the format of a table Kind writer/user/programmer Tables 0 October 29th 04 02:52 AM


All times are GMT +1. The time now is 11:50 PM.

Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 Microsoft Office Word Forum - WordBanter.
The comments are property of their posters.
 

About Us

"It's about Microsoft Word"