Results 1 to 4 of 4

Thread: [RESOLVED] [Word] How do I write/ insert photo in the header and footer?

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Location
    Norco, CA
    Posts
    16

    Resolved [RESOLVED] [Word] How do I write/ insert photo in the header and footer?

    All,
    I'm developing a program in VB and want to write to a word doc. I have learned how to create a new Word doc, now I'm writing to it and i'm looking for code to insert and format information into the header. Any help would be appreciated.

    Thanks,

  2. #2
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Word] How do I write/ insert photo in the header and footer?

    try recording a macro

    the code should be something like
    Code:
    d.Sections(1).Headers(1).Shapes.AddPicture FileName, , True, posleft, postop, picwidth, picheight
    where d is a document object and parameters valid to suit
    there are 3 headers, that can be used general (all pages), righthand pages (or is that left) and firstpage only, help files will give more information
    afaik all sections will use the same headers, despite that it looks like each section can use different ones
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Oct 2013
    Location
    Norco, CA
    Posts
    16

    Re: [Word] How do I write/ insert photo in the header and footer?

    Thank you, this gets me closer. Why is it when I try and record a Macro it gives me the frown face and I cant click into items, but only go through the menu ribbon?Name:  images.jpg
Views: 194
Size:  2.3 KB

  4. #4
    PowerPoster
    Join Date
    Dec 2004
    Posts
    25,618

    Re: [Word] How do I write/ insert photo in the header and footer?

    that is what macro recorder does, keyboard shortcuts and menus still work
    i do my best to test code works before i post it, but sometimes am unable to do so for some reason, and usually say so if this is the case.
    Note code snippets posted are just that and do not include error handling that is required in real world applications, but avoid On Error Resume Next

    dim all variables as required as often i have done so elsewhere in my code but only posted the relevant part

    come back and mark your original post as resolved if your problem is fixed
    pete

Tags for this Thread

Posting Permissions

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



Click Here to Expand Forum to Full Width