DaveBlakeMAAT
Board Regular
- Joined
- Feb 28, 2016
- Messages
- 190
Hi
I am hoping there is a boffin that can help?
I tend to do all my VBA in Excel as an accountant, but I have a scenario where I have to do some VBA in Word and I am struggling with which methods to use.
I have a pre-generated word specification document that I need to insert the corporate graphics (which is sized to A4) to after the specification is generated, I have been playing with shapes and inlineShapes, the main problems are the following:
1) The graphic file I need to add is a full page graphic that should cover the entire page width/height (100%*100%) (ignoring page margins)
2) The graphic needs to be added behind the existing text
3) The graphic will be different depending on page number (1st page master graphic, last 2 pages no graphic & all other pages should be the continuation graphic)
4) No fixed document length (guessing I will need to cycle through the pages collection and use a case/if statement for this)
Unfortunately, the graphic can not be broken down into header/footer portions.
I currently have the following, however this locates the image inside the margins and shrinks the graphic to fit.
I do not know if I am heading in the right direction, so any pointers would be greatly appreciated.
I am hoping there is a boffin that can help?
I tend to do all my VBA in Excel as an accountant, but I have a scenario where I have to do some VBA in Word and I am struggling with which methods to use.
I have a pre-generated word specification document that I need to insert the corporate graphics (which is sized to A4) to after the specification is generated, I have been playing with shapes and inlineShapes, the main problems are the following:
1) The graphic file I need to add is a full page graphic that should cover the entire page width/height (100%*100%) (ignoring page margins)
2) The graphic needs to be added behind the existing text
3) The graphic will be different depending on page number (1st page master graphic, last 2 pages no graphic & all other pages should be the continuation graphic)
4) No fixed document length (guessing I will need to cycle through the pages collection and use a case/if statement for this)
Unfortunately, the graphic can not be broken down into header/footer portions.
I currently have the following, however this locates the image inside the margins and shrinks the graphic to fit.
Code:
ActiveDocument.Shapes.AddPicture _
FileName:= FilePath, LinkToFile:= False, SaveWithDocument:=True, Left:=0, Top:=0
I do not know if I am heading in the right direction, so any pointers would be greatly appreciated.