A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Word » Tables
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

Manual update for 'Excel to Word' table



 
 
Thread Tools Display Modes
  #1  
Old October 6th, 2008, 05:32 PM posted to microsoft.public.word.tables
musicgold via OfficeKB.com
external usenet poster
 
Posts: 1
Default 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
Thanks,

MG.

--
Message posted via http://www.officekb.com

 




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump


All times are GMT +1. The time now is 01:54 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.