Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
Tables in Word Automation
Message
 
À
10/09/2003 16:43:08
Information générale
Forum:
Visual FoxPro
Catégorie:
COM/DCOM et OLE Automation
Divers
Thread ID:
00827963
Message ID:
00828000
Vues:
18
It isn't stored in the document, there is no way to store it in the doc.

But I don't see why this wouldn't work. If I get you right you just want to show to the user a document that you create on the fly but you want to be sure that the lines won't be there...
oWord = CREATEOBJECT("Word.Application")
oDoc = oWord.documents.add()
oRange = oDoc.Range
nRows = 2
nColumns = 2
nTableBehavior = 0
nAutoFit = 0
**** Create the document you want them to see
oDoc.Tables.Add( oRange, nRows, nColumns, nTableBehavior, nAutoFit )
oDoc.tables(1).Cell[1,1].Range.InsertAfter("The Trick is to wait until all the formatting's done")
oDoc.tables(1).Cell[1,2].Range.InsertAfter("That the tablegridlines have been disabled")
oDoc.tables(1).Cell[2,1].Range.InsertAfter("Prior to let the user see the document")
oDoc.tables(1).Cell[2,2].Range.InsertAfter("That is, oWord.visible = .T.")
oDoc.tables(1).borders.enable = .F.
*** make sur Word's tablegridline setting is turned off. 
oDoc.ActiveWindow.View.TableGridlines = .F.
*** let the user see your doc
oWord.visible = .T.
Unless you save the doc file for further reference and that this doc will be opened without VFP's help directly from word it would work... if the latest is how you intend it to work then you can't be sure of the setting and need to find another way to format it...

>Thanks for your response Yanick.
>
>This does work, but there is a problem. I need to insure that everyone who views this document (at least when they initially open it) views it without the gridlines. It looks like the ActiveWindow.View object is not stored in the Word document.
>
>It seems to depend on how each user has their Word environment set up.
>After trying out your code I searched around the Word environment and saw where they can set the TableGridLines property.
>
>If there is another way of making sure the gridlines are not viewable I'd give it a try. If not, I'll try formating these sections of the document without using a table.
>
>thanks again.
Précédent
Suivant
Répondre
Fil
Voir

Click here to load this message in the networking platform