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

    Home » Forums » AskWoody support » Productivity software by function » MS Word and word processing help » Creating a macro using the F5 key (MS Word 2003)

    Author
    Topic
    #437187

    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 🙂

    Viewing 0 reply threads
    Author
    Replies
    • #1038563

      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?

      • #1038564

        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

        • #1038565

          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?

        • #1038569

          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

          • #1038574

            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.

            • #1038576

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

            • #1038585

              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.

            • #1038590

              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.

            • #1038591

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

            • #1038656

              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

            • #1038592

              OK, the idea is as follows:

              • Create a new template.
              • Insert the signature into the template.
              • Select the signature, then select Insert | AutoText | AutoText.
                [l]Select your template in the Look in dropdown (this is important!)
              • Assign a name, for example Signature, then click Add.
              • Now delete the signature from the body of the template.
              • Switch to the Visual Basic Editor.
              • Select Insert | Module.
              • 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

              • Switch back to Word.
              • Select Tools | Customize…
              • Click Keyboard…
              • Select your template in the ‘Save changes in’ dropdown.
              • Select Macros in the list of Categories.
              • Select InsertSignature in the list of Macros.
              • Click in the ‘Press new shortcut key’ box.
              • Press F5.
              • Click Assign.
              • Click Close twice.
              • Save the template as Sig.dot in your Word startup folder.
              • 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.

            • #1038614

              Hi,

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

              Thanks a lot for your help.

    Viewing 0 reply threads
    Reply To: Creating a macro using the F5 key (MS Word 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: