The Notebook Review forums were hosted by TechTarget, who shut down them down on January 31, 2022. This static read-only archive was pulled by NBR forum users between January 20 and January 31, 2022, in an effort to make sure that the valuable technical information that had been posted on the forums is preserved. For current discussions, many NBR forum users moved over to NotebookTalk.net after the shutdown.
Problems? See this thread at archive.org.

    Can someone help with a simple macro?

    Discussion in 'Windows OS and Software' started by akwit, Jun 8, 2009.

  1. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    I have absolutely no knowledge of macros, but I do know that I need to "make" one that will allow me to automatically place my company logo and copy on any word document with the press of a button.

    I used to have it at my old company where we just pushed a smiley face button that was found at the top of our word document that would place the logo and copy, perfectly centered on the document we were using at that time.

    Is this something I can learn how to do or do I have to get someone to do it for me?
     
  2. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    You could learn to do it, but the far simpler method is to create a template for this kind of thing.

    Then, when you want such a document, you choose NEW > and pick that template.
     
  3. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    Theres a problem with a template; for some reason, templates get "grayed out" when added to a document. I need the full color version. If you know how to get around this, id love to hear how cuz I cant seem to figure it out.
     
  4. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    The PRINTED document is grayed out or the one on the screen?

    The grayed out effect is a visual queue so you know what part is template and what part is document

    When printing, it will all come out as desired
     
  5. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    Apologies...I was mistaken-I was referring to Headers and Footers.

    The template seems to not gray out however, I can you tell me how to add it to an existing word document?
     
  6. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    Not sure I am following you....what I would do is probably select everything (ctrl+a) copy it, (ctrl+c), open template then paste (ctrl+v)

    If you have many documents, I probably would create a macro.

    Would need to know what version of Word you use to give you exact instructions, but the basics would be to place your logo in a fixed location (ex: Documents\LogoImages) and then use the RECORD MACRO function, then save, and apply a key combo to it, then save this document (or import the macro) to your default template.

    With Office 2007 its a tad more complicated to add things to the ribbon--it's easier to show and customize the quick access toolbar
     
  7. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    I am a recruiter so I am constantly adding my contact info/logo to the tops of resumes, hence my need for a macro.
    The copy and paste thing would not work for me.

    I am using Outlook 2007; can you explain how I may be able to do this?
     
  8. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    what exactly are you attempting to insert?
     
  9. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    My company logo, name and contact info at the top of every page, address and other basic info at the bottoms.
     
  10. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    The problem here is I cannot get it to look pretty...I never tried placing an image in a Word macro before. With Excel, you can create a range and place the image there, but I am puzzling over how this is done in word.

    I now see why you were talking about headers and footers before because this seems to be the only way to do this (put it on top and bottom of every page)

    So far, what I am getting is everything vertical

    company logo image
    name
    contact info

    --------------

    content of document

    --------------


    address
    info


    Since you cannot manipulate the mouse via a macro you can not set image parameters the way you would in Word with a mouse.

    The record doesn't work perfectly and you need to go in and edit the VBA to get it to work, but the code looks like this

    Code:
    
    
    ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        Selection.TypeText Text:="Name"
        Selection.TypeParagraph
        Selection.TypeText Text:="xxx-xxx-xxxx"
        Selection.TypeParagraph
        Selection.TypeParagraph
        Selection.InlineShapes.AddPicture FileName:= _
            "C:\Users\{username}\Documents\logogimages\logo.gif", LinkToFile:=False, _
            SaveWithDocument:=True
        WordBasic.ViewFooterOnly
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageFooter
        Selection.TypeText Text:="Street address"
        Selection.TypeParagraph
        Selection.TypeText Text:="City, State Zipcode"
        Selection.TypeParagraph
        Selection.TypeText Text:="Company slogan"
        ActiveWindow.ActivePane.View.SeekView = wdSeekCurrentPageHeader
        ActiveWindow.ActivePane.View.SeekView = wdSeekMainDocument
    
    
    The end result looks something like this:

    [​IMG]
     
  11. akwit

    akwit Notebook Deity

    Reputations:
    24
    Messages:
    755
    Likes Received:
    0
    Trophy Points:
    30
    gerry-

    I found the following instructions online:

    # Click Insert at the top of your screen;
    # Click Quick Parts.
    # Select Field at the bottom of the Quick Parts menu
    # In the Categories filed select Document Information.
    # In the Field Names window, select FileName.
    # In the Field Properties to the right, select one of the options if you want all capitals, etc.
    # Under Field Options, check the Add path to file name box.
    # Click OK.

    I did the above after I assigned the macro to a button/keystroke.
    No idea how it works, but it did.
     
  12. gerryf19

    gerryf19 I am the walrus

    Reputations:
    2,275
    Messages:
    3,990
    Likes Received:
    0
    Trophy Points:
    105
    glad to hear it--seems to be a more elegant solution to my efforts