• macro recorder, format picture (2003)

    Author
    Topic
    #453133

    Am I right in discovering that the macro recorder is uneager to handle formatting an inserted picture?
    Objectives = crop it by specified amount top and bottom, change layout to ‘behind text’, place at specified location on page, defeat ‘move object with text’.
    (Even better – is there a way of including pictures in a mail merge, different picture as ‘part of’ each record?)
    Thanks in advance.

    Viewing 2 reply threads
    Author
    Replies
    • #1121107

      You can have a include a different picture for each record as follows:
      – Create a picture for each record; store the pictures in a single folder, let’s say in C:Pictures.
      – Add a field to the data source for the mail merge that contains the file name of the picture. Let’s say you name it PicFile.
      – Create a field like this in the merge document:

      { INCLUDEPICTURE “C:Pictures{ MERGEFIELD PicFile }” }

      – Remember, you should never type the field braces { } yourself, either press Ctrl+F9 to insert them or use Insert | Field…
      – Note: after merging, you will probably have to select the resulting document (Ctrl+A) and update fields (F9) to see the correct pictures.

    • #1121108

      Hi John,

      You could embed your mailmerge MERGEFIELD in an INCLUDEPICTURE field, like so:
      {INCLUDEPICTURE “C:My DocumentsMy Pictures{MERGEFIELD ImageName}”}

      Note: The field brace pairs (ie ‘{ }’) for the above example are created via Ctrl-F9 – you can’t simply type them or copy & paste them from this message.

      Cheers,
      Paul Edstein
      [Fmr MS MVP - Word]

    • #1121111

      Some aspects of formatting a picture can be recorded, such as cropping, but others, such as convert from inline to floating or back, are unavailable while recording a macro. So you’ll have to write the code for that yourself. If you want to convert an inline shape to a floating one behind text, you can use something like

      Dim shp As Shape
      Set shp = ActiveDocument.InlineShapes(1).ConvertToShape
      shp.WrapFormat.Type = wdWrapNone

    Viewing 2 reply threads
    Reply To: macro recorder, format picture (2003)

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

    Your information: