Results 1 to 3 of 3
  1. #1
    New Lounger
    Join Date
    Sep 2002
    Thanked 0 Times in 0 Posts

    Trouble fine tuning inserted figure (Word 2000 SP3)

    I regularly insert figures from a vector drawing program (SmartDraw) into a Word document. I want them to be inserted in-line and to be maintained within the margins of the page. In Word 97 I had this automated in a macro with a button on a button bar. I'd do a copy of the figure in SmartDraw, then press the button and it would be inserted at the cursor location within the margins - that is, if it was too large, it would automatically reduce in size proportionately until it fit.

    My got smashed, and the backup copy I had didn't have this macro in it (I know, I know <sigh>). I didn't think much of it, and just set out to re-record the macro. But when recording, and I attempt to change the location of the inserted figure to in-line, that option is grayed out. I also can't change the size. If I stopped recording, exited the figure box then went back in, I could make it in-line and change the size. But when I attempted to record this exercise and paste the results into the original (paste it in) macro, it doesn't work. I know this is cryptic and probably filled with the wrong words for things and missing vital information, so I'm happy to give more information as requested. But I'd really like to get my button back.

    Any help will be greatly appreciated.



  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Thanked 31 Times in 31 Posts

    Re: Trouble fine tuning inserted figure (Word 2000 SP3)

    The instruction to paste as an inline shape is

    Selection.PasteSpecial Placement:=wdInLine

    I don't know how you want to determine when to resize, but perhaps you can adapt and adapt the following to your needs. It acts on the selection (after pasting, the picture is still selected).

    Dim MaxWidth As Long
    MaxWidth = InchesToPoints(6)

    With Selection.InlineShapes(1)
    If .Width > MaxWidth Then
    .ScaleHeight = MaxWidth / .Width * 100
    .ScaleWidth = MaxWidth / .Width * 100
    End If
    End With

  3. #3
    Super Moderator
    Join Date
    Jan 2001
    Melbourne, Victoria, Australia
    Thanked 295 Times in 267 Posts

    Re: Trouble fine tuning inserted figure (Word 2000 SP3)

    I use this quick and dirty macro to manage all my PasteSpecial needs. It brings up a dialog to allow me to choose which type I want to paste so it works for text as well. You could marry this with Hans' code to add resizing the graphic.
    <pre>Sub EditPasteSpecial()
    Dim iView As Integer, iCount As Integer
    On Error Resume Next
    iView = ActiveWindow.ActivePane.View.Type
    iCount = ActiveDocument.Shapes.count
    If ActiveDocument.Shapes.count > iCount Then
    ActiveDocument.Shapes(iCount + 1).ConvertToInlineShape
    End If
    ActiveWindow.ActivePane.View.Type = iView
    End Sub</pre>

    Andrew Lockton, Chrysalis Design, Melbourne Australia

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts