Reply
 
LinkBack Thread Tools Search this Thread Display Modes
  #1   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Control a Table in Word From Excel

Hi, I use code that sends a range of excel tables to bookmarks in word. It
all works well (I have modified the following code if curious
http://www.vbaexpress.com/kb/getarticle.php?kb_id=133 )

Once a table or picture is sent to word, I'd like to be able to format it Eg
IncrementRotation -90 or wdAutoFitContent


I get a run time error on the 3rd line of the following code:

appWrd.Selection.PasteSpecial DataType:=wdPasteRTF, Placement:=wdInLine
appWrd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
appword.Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)

I've tried a few ways of trying to pick up the table i've just created in
word, but struggling.

Any help would be appreciated.

Regards
Simon




  #2   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 718
Default Control a Table in Word From Excel

Probably a typo: yo types appword instead of appWrd

Cheers
--
AP

"Simon" a écrit dans le message de news:
...
Hi, I use code that sends a range of excel tables to bookmarks in word. It
all works well (I have modified the following code if curious
http://www.vbaexpress.com/kb/getarticle.php?kb_id=133 )

Once a table or picture is sent to word, I'd like to be able to format it
Eg
IncrementRotation -90 or wdAutoFitContent


I get a run time error on the 3rd line of the following code:

appWrd.Selection.PasteSpecial DataType:=wdPasteRTF, Placement:=wdInLine
appWrd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
appword.Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)

I've tried a few ways of trying to pick up the table i've just created in
word, but struggling.

Any help would be appreciated.

Regards
Simon






  #3   Report Post  
Posted to microsoft.public.excel.programming
external usenet poster
 
Posts: 172
Default Control a Table in Word From Excel

Hi, thanks Ardus....you were correct....table works ok now.

However I'm still having trouble trying the control a 'picture' in word. I'm
using the following code:

appWrd.Selection.PasteSpecial DataType:=wdPasteEnhancedMetafile,
Placement:=wdInLine
appWrd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
appWrd.Selection.Shape(1).ShapeRange.IncrementRota tion -90

I get a run time error on the third line. Any idea how I can rotate the
picture I have just pasted into word?


"Ardus Petus" wrote:

Probably a typo: yo types appword instead of appWrd

Cheers
--
AP

"Simon" a écrit dans le message de news:
...
Hi, I use code that sends a range of excel tables to bookmarks in word. It
all works well (I have modified the following code if curious
http://www.vbaexpress.com/kb/getarticle.php?kb_id=133 )

Once a table or picture is sent to word, I'd like to be able to format it
Eg
IncrementRotation -90 or wdAutoFitContent


I get a run time error on the 3rd line of the following code:

appWrd.Selection.PasteSpecial DataType:=wdPasteRTF, Placement:=wdInLine
appWrd.Selection.ParagraphFormat.Alignment = wdAlignParagraphCenter
appword.Selection.Tables(1).AutoFitBehavior (wdAutoFitContent)

I've tried a few ways of trying to pick up the table i've just created in
word, but struggling.

Any help would be appreciated.

Regards
Simon







Reply
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules

Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On


Similar Threads
Thread Thread Starter Forum Replies Last Post
Control Excel from Word ryguy7272 Excel Programming 2 July 24th 07 08:42 PM
Control Word through Excel Jocke Excel Programming 1 June 24th 05 03:38 PM
Word Control in Excel Stuart[_5_] Excel Programming 10 July 11th 04 08:47 PM
how to control word from excel Torstein S. Johnsen[_2_] Excel Programming 1 February 10th 04 02:10 PM
Print Control in Word/Excel losmac[_2_] Excel Programming 0 December 30th 03 08:22 PM


All times are GMT +1. The time now is 05:24 PM.

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

About Us

"It's about Microsoft Excel"