Ureader.com  
Microsoft software help and Community
   home   |   control panel login   |   archive   |  
 
Word
application.errors
conversions
docmanagement
drawing.graphics
formatting.longdocs
international
internet.assistant
mail
mailmerge.fields
menustoolbars
newusers
numbering
oleinterop
pagelayout
printingfonts
setup.networking
spelling.grammar
tables
vba.addins
vba.beginners
vba.customization
vba.general
vba.userforms
web.authoring
word6-7macros
word97vba
  
 
date: Mon, 06 Oct 2008 16:32:50 GMT,    group: microsoft.public.word.tables        back       


Manual update for 'Excel to Word' table   
Hi,

I am trying to create a macro to copy an Excel table into a Word document.
The macro need to perform the following three steps. I am stuck with the
third step. It is also not possible to record a macro for this step.  Can you
please help me with that?  

1.	Paste the Excel table  in the clipboard at the cursor location in the word
document. (Pastespecial) 
2.	Format the table 
3.	Change the update option to ‘Manual Update’ ( this can be done manually as
follows:  Edit --> links--> Manual Update )

My code:

[code]
..

Selection.PasteSpecial Link:=True, DataType:=wdPasteHTML    '  paste table
into Word

Dim tbl As Table

For Each tbl In Selection.Tables
  
  tbl.Rows.HeightRule = wdRowHeightAuto
  tbl.Rows.Height = InchesToPoints(0)                 ' format the table
  tbl.AutoFitBehavior (wdAutoFitWindow)
  
  Next tbl

--------------------------------------------- ‘ the part after this is not
working.
Dim alf As Shape
For Each alf In ActiveDocument.Shapes
If alf.Type = msoLinkedOLEObject Then
alf.LinkFormat.AutoUpdate = False
End If
Next

[/code]

Thanks,

MG.

-- 
Message posted via http://www.officekb.com
date: Mon, 06 Oct 2008 16:32:50 GMT   author:   musicgold via OfficeKB.com u40543@uwe

Google
 
Web ureader.com


    COPYRIGHT 2007, YARDI TECHNOLOGY LIMITED, ALL RIGHT RESERVE  |   contact us