-
Sep 16th, 2014, 04:16 PM
#1
Thread Starter
Junior Member
[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,
-
Sep 16th, 2014, 04:33 PM
#2
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
-
Sep 16th, 2014, 05:03 PM
#3
Thread Starter
Junior Member
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?
-
Sep 17th, 2014, 04:57 AM
#4
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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|