• Trouble fine tuning inserted figure (Word 2000 SP3)

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Trouble fine tuning inserted figure (Word 2000 SP3)

    Author
    Topic
    #396184

    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 normal.dot got smashed, and the backup copy I had didn’t have this macro in it (I know, I know ). 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.

    Thanks,

    Dave

    Viewing 3 reply threads
    Author
    Replies
    • #740538

      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

    • #740539

      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

    • #740861

      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.

      Sub EditPasteSpecial()
        Dim iView As Integer, iCount As Integer
        On Error Resume Next
        iView = ActiveWindow.ActivePane.View.Type
        iCount = ActiveDocument.Shapes.count
        Dialogs(wdDialogEditPasteSpecial).Show
        If ActiveDocument.Shapes.count > iCount Then
          ActiveDocument.Shapes(iCount + 1).ConvertToInlineShape
        End If
        ActiveWindow.ActivePane.View.Type = iView
      End Sub
    • #740862

      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.

      Sub EditPasteSpecial()
        Dim iView As Integer, iCount As Integer
        On Error Resume Next
        iView = ActiveWindow.ActivePane.View.Type
        iCount = ActiveDocument.Shapes.count
        Dialogs(wdDialogEditPasteSpecial).Show
        If ActiveDocument.Shapes.count > iCount Then
          ActiveDocument.Shapes(iCount + 1).ConvertToInlineShape
        End If
        ActiveWindow.ActivePane.View.Type = iView
      End Sub
    Viewing 3 reply threads
    Reply To: Trouble fine tuning inserted figure (Word 2000 SP3)

    You can use BBCodes to format your content.
    Your account can't use all available BBCodes, they will be stripped before saving.

    Your information: