Results 1 to 5 of 5
  1. #1
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Birmingham, England
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts

    macro recorder, format picture (2003)

    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.

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: macro recorder, format picture (2003)

    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.

  3. #3
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,055
    Thanks
    2
    Thanked 417 Times in 346 Posts

    Re: macro recorder, format picture (2003)

    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
    [MS MVP - Word]

  4. #4
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: macro recorder, format picture (2003)

    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

  5. #5
    2 Star Lounger
    Join Date
    Sep 2002
    Location
    Birmingham, England
    Posts
    123
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: macro recorder, format picture (2003)

    Thank you both VERY much indeed.

Posting Permissions

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