![]() |
|
#1
|
||||
|
||||
![]()
Referencing cells within an embedded Excel object isn't exactly straightforward, mainly because Office provides no deactivation method. Besides which, it's not apparent how you'd propose to make this work in the context of a mailmerge, unless the mailmerge is itself a macro-driven process. In any event, if you want to shrink or expand text, why not use a table cell with the 'Fit text' attribute set?
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
#2
|
||||
|
||||
![]()
Thanks for responding.
I've tried the fit text thing before - it sounded like what I wanted initially, but unfortunately the result is that word just stretches the text, which can produce some ugly results. What I'm really after is something that will adjust the font size to fit instead, so it doesn't look distorted. To address your other point, I had envisioned running a mail merge by looping through the document's datasource in vba and printing the current record as I went - not ideal I know, but it would have to be something like that to get the excel cell updated with each record as it looped. I've been toying with this sort of thing: Dim objExcel As New Excel.Application Dim exWb As Excel.Workbook Set exWb = objExcel.Workbooks.Open("c:\mergesource.xls") exWb.Sheets("Sheet1").Cells(1, 1) = "Hello there" MsgBox exWb.Sheets("Sheet1").Cells(1, 1) This displays the corrected 'Hello there' text in the msgbox, but does not update the excel object in, so it doesn't help unless I can find some way to update or refresh it (the aim being to be able to make use of Excel's ability to re-size the text and then merge to this). I guess this is what you meant when referring to the 'deactivation method'? I'm starting to get the feeling I'm trying to get Word to do something it just doesn't want to do, and that never seems to lead to a positive result.... |
![]() |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
tinfanide | Excel | 10 | 08-05-2015 01:17 PM |
![]() |
lily | Excel | 9 | 10-23-2014 06:21 AM |
![]() |
TimTDP | Visio | 12 | 01-26-2014 12:43 AM |
An embedded object's formatting gets jumbled | New Daddy | PowerPoint | 0 | 11-17-2013 08:13 PM |
![]() |
DugganSC | Word VBA | 1 | 08-29-2011 01:40 PM |