Results 1 to 13 of 13
  1. #1
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Creating a macro using the F5 key (MS Word 2003)

    Hi all,
    I need to create a macro to insert an image into word. Basically the image is the signature of my manager. I need to create it to insert this image and it must run of the F5 key.
    Your assistance is highly appreciated.
    Thanks :-)

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

    Re: Creating a macro using the F5 key (MS Word 2003)

    Welcome to Woody's Lounge!

    Why don't you create an AutoText entry for the image? That way, you don't need any code.

    If you still prefer a macro, we'd have to know a bit more. Is the signature a file? If so, is it stored on hard disk, or on a network drive?

  3. #3
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a macro using the F5 key (MS Word 2003)

    Hi,

    Thanks for the prompt response. I need to have a macro and the signature is a .jpg file that is stored on the local machine.

    Thanks

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

    Re: Creating a macro using the F5 key (MS Word 2003)

    Sorry for all the questions. Is this to be for your personal use only, or do you want to distribute the macro to other users?

  5. #5
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Creating a macro using the F5 key (MS Word 2003)

    I still wonder why you must have it as a macro. I have a scanned signature that I use, stored as autotext. I type sig, press F3 and my signature appears. Why does that not work for you?

    Ian

  6. #6
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a macro using the F5 key (MS Word 2003)

    Hi,

    @Ian, if I use the Autotext option will I be able to use F5 as the shortcut key? If so could you explain how to use it such that I insert the image.

    @HansV, It is not for myself, I want to create this on 4 managers machines as they need to sign off work that needs to go to clients.

    Thanks for the help guys.

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

    Re: Creating a macro using the F5 key (MS Word 2003)

    Why is the F5 so essential? The standard method for inserting AutoText is to type the name of the AutoText entry and press F3.

  8. #8
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a macro using the F5 key (MS Word 2003)

    Hi,
    Its just that the managers are elderly and would want things to work they had it before. They got new laptops and the guys did not image the latops correctly. I can try and talk them into using F3 but they had it with the F5 button before and would want it that way again, therefor I asked for a macro as I was unsure if the Autotext would work with F5.

  9. #9
    Gold Lounger
    Join Date
    Feb 2004
    Location
    Cape Town, RSA
    Posts
    3,444
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Creating a macro using the F5 key (MS Word 2003)

    How about recording a macro to insert the .jpg on each managers machine , and then simply assign the macro to the F5 button. That should do the trick.
    Regards,
    Rudi

  10. #10
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a macro using the F5 key (MS Word 2003)

    Hi, after I create the macro how to assign the shortcut key?

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

    Re: Creating a macro using the F5 key (MS Word 2003)

    OK, the idea is as follows:
    <UL><LI>Create a new template.
    <LI>Insert the signature into the template.
    <LI>Select the signature, then select Insert | AutoText | AutoText.
    [l]Select your template in the Look in dropdown (this is important!)
    <LI>Assign a name, for example Signature, then click Add.
    <LI>Now delete the signature from the body of the template.
    <LI>Switch to the Visual Basic Editor.
    <LI>Select Insert | Module.
    <LI>Create a macro in the module:

    Sub InsertSignature()
    Dim tmp As Template
    For Each tmp In Templates
    If tmp.Name = "Sig.dot" Then
    tmp.AutoTextEntries("Signature").Insert _
    Where:=Selection.Range, RichText:=True
    Exit For
    End If
    Next tmp
    End Sub


    <LI>Switch back to Word.
    <LI>Select Tools | Customize...
    <LI>Click Keyboard...
    <LI>Select your template in the 'Save changes in' dropdown.
    <LI>Select Macros in the list of Categories.
    <LI>Select InsertSignature in the list of Macros.
    <LI>Click in the 'Press new shortcut key' box.
    <LI>Press F5.
    <LI>Click Assign.
    <LI>Click Close twice.
    <LI>Save the template as Sig.dot in your Word startup folder.
    <LI>Restart Word to check whether F5 works.[/list]When everything works as intended, you can install Sig.dot in the Word startup folder of each of the users.

    I have attached a zipped template as an example.
    Attached Files Attached Files

  12. #12
    New Lounger
    Join Date
    Nov 2006
    Posts
    6
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Re: Creating a macro using the F5 key (MS Word 2003)

    Hi,

    Awesome stuff :-)
    A bit of trial and error, but all worked one hundred percent.

    Thanks a lot for your help.

  13. #13
    Bronze Lounger IanWilson's Avatar
    Join Date
    Dec 2000
    Location
    Bristol, United Kingdom
    Posts
    1,523
    Thanks
    0
    Thanked 1 Time in 1 Post

    Re: Creating a macro using the F5 key (MS Word 2003)

    There's still no need for a macro. You can have the signature as a bit of autotext and assign F5 to that. Insert the scanned signature into a document just once on the machine. Select it, go to Tools - Autocorrect Options - Autotext and add the autoext with a name such as sig or whatever you want. Ok that. Then Tools - Customize and click the keyboard button. In the left hand "specify a command" column, find Autotext, then in the right hand box find sig (or whatever you called it). Click your mouse in the press new shortcut key box, then press F5. OK your way out of all that. Close the document and when you are asked if you want to save changes to the document template Normal.dot, say yes. You should then find that F5 produces your signature, with no need for macros at all.

    Ian

Posting Permissions

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