Results 1 to 5 of 5
  1. #1
    New Lounger
    Join Date
    Apr 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hello-

    I've posted on this forum for 1 or 2 other issues and was AMAZED by how great the responses were!

    I'm a Word novice and only just recently found out that there is such a thing called a Macro. I need to create a form that allows recipients to answer some questions and then include 4 or 6 images. I know how to do the first step (creating the text form fields) but I can't seem to figure out how to do the image part at all. I need to know how to properly record/edit the Macro, or find one that I can copy and paste that actually works. Then I need to know how to make something that the user can click on that will open up a dialogue box for them to select their image, such as a line of text or a button that says "Click here to add image." I would prefer to have 4 or 6 separate buttons for them to click and insert.

    Additionally, I am on a Mac running Word 2004 version 11.1. I do, however, have access to a couple of PCs that run either Word 2003 or 2007. The end users of this form will be on a PC.

    Any help would be greatly appreciated!
    -Chrissy

  2. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    [quote name='CGS' post='797973' date='14-Oct-2009 12:49']I need to create a form that allows recipients to answer some questions and then include 4 or 6 images. I know how to do the first step (creating the text form fields) but I can't seem to figure out how to do the image part at all. I need to know how to properly record/edit the Macro, or find one that I can copy and paste that actually works. Then I need to know how to make something that the user can click on that will open up a dialogue box for them to select their image, such as a line of text or a button that says "Click here to add image." I would prefer to have 4 or 6 separate buttons for them to click and insert.[/quote]
    Four or six buttons in the document, or in a dialog box? If they are buttons in the document, would the image replace the button (or sit below it)?

    If you like the way that Word's native Insert > Picture > From file dialog works, you should be able to pop that up in a macro, capture the file name(s) the user wants to insert, and then place them in the document. There is one little problem, though, and that is the form protection. You can't insert images into a protected part of the document. You either could inset a (continuous) section break and insert the images into the unprotected part of the document, or you could unprotect and reprotect the document in your macro to accommodate the insertion.

  3. #3
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts
    I have attached a document created in Word 2002 that shows one way (of several possible ways) to do this, using MACROBUTTON fields. I have no idea whether it works in Word for Macintosh.

    Each of the three MACROBUTTON fields runs a macro when double-clicked that displays the Insert Picture dialog and inserts the picture at the position of a predefined bookmark. The bookmarks must be named Pic1, Pic2 etc.

    Activate the Visual Basic Editor to see the code I used.

    Note: users must enable macros, otherwise the macrobuttons won't work.
    Attached Files Attached Files

  4. #4
    Super Moderator
    Join Date
    May 2002
    Location
    Canberra, Australian Capital Territory, Australia
    Posts
    5,054
    Thanks
    2
    Thanked 417 Times in 346 Posts
    [quote name='CGS' post='797973' date='15-Oct-2009 06:49']Hello-

    I've posted on this forum for 1 or 2 other issues and was AMAZED by how great the responses were!

    I'm a Word novice and only just recently found out that there is such a thing called a Macro. I need to create a form that allows recipients to answer some questions and then include 4 or 6 images. I know how to do the first step (creating the text form fields) but I can't seem to figure out how to do the image part at all. I need to know how to properly record/edit the Macro, or find one that I can copy and paste that actually works. Then I need to know how to make something that the user can click on that will open up a dialogue box for them to select their image, such as a line of text or a button that says "Click here to add image." I would prefer to have 4 or 6 separate buttons for them to click and insert.

    Additionally, I am on a Mac running Word 2004 version 11.1. I do, however, have access to a couple of PCs that run either Word 2003 or 2007. The end users of this form will be on a PC.

    Any help would be greatly appreciated!
    -Chrissy[/quote]Hi Chrissy,

    The simplest way to do what you're after is to insert Section breaks into the document, either side of where the images are to be inserted, and leave those Sections unprotected. That way, no macros are needed and the images can be inserted in the normal manner, via Word's Insert|Picture dialogue box. It also means the users can insert other objects (eg Excel worksheets) or type some additional text into the unprotected Sections. Depending on your view of these things, that might be beneficial.
    Cheers,

    Paul Edstein
    [MS MVP - Word]

  5. #5
    New Lounger
    Join Date
    Apr 2007
    Posts
    5
    Thanks
    0
    Thanked 0 Times in 0 Posts
    [quote name='HansV' post='797983' date='14-Oct-2009 21:10']I have attached a document created in Word 2002 that shows one way (of several possible ways) to do this, using MACROBUTTON fields. I have no idea whether it works in Word for Macintosh.

    Each of the three MACROBUTTON fields runs a macro when double-clicked that displays the Insert Picture dialog and inserts the picture at the position of a predefined bookmark. The bookmarks must be named Pic1, Pic2 etc.

    Activate the Visual Basic Editor to see the code I used.

    Note: users must enable macros, otherwise the macrobuttons won't work.[/quote]

    THANK YOU!!! This worked perfectly!!!

Posting Permissions

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