![]() |
#1
|
|||
|
|||
![]()
Hi,
Looking for some help please... I'm trying to create a word macro which will insert a logo and address details into the 1st page header & bookmark them. I can't use a template as we generate word documents from a DMS. So far from using macro examples found on the internet I have... Sub AddLogo() Application.ScreenUpdating = False ActiveDocument.PageSetup.DifferentFirstPageHeaderF ooter = True Dim sh As Shape Dim hdr As HeaderFooter Dim rng As Range Dim strPicture As String strPicture = "Z:\Logo1.jpg" For Each hdr In ActiveDocument.Sections(1).Headers Set rng = hdr.Range rng.Collapse wdCollapseEnd Set sh = ActiveDocument.Shapes.AddPicture(strPicture, False, True, 0, 0, , , rng) With sh .Height = CentimetersToPoints(4.94) .Width = CentimetersToPoints(3.58) .LockAspectRatio = True .Left = CentimetersToPoints(13.67) .Top = CentimetersToPoints(-1.23) .WrapFormat.AllowOverlap = True .WrapFormat.Side = wdWrapNone End With Next hdr strPicture = "Z:\Logo2.jpg" For Each hdr In ActiveDocument.Sections(1).Headers Set rng = hdr.Range rng.Collapse wdCollapseEnd Set sh = ActiveDocument.Shapes.AddPicture(strPicture, False, True, 0, 0, , , rng) With sh .Height = CentimetersToPoints(4.29) .Width = CentimetersToPoints(4.84) .LockAspectRatio = True .Left = CentimetersToPoints(7.83) .Top = CentimetersToPoints(-0.27) .WrapFormat.AllowOverlap = True .WrapFormat.Side = wdWrapNone End With Next hdr End Sub This adds a couple of logos into the header but for every page rather than the first page. I'm also not sure how to bookmark the image being added so I can hide it later on in a separate print macro. Thanks for any help. |
|
![]() |
||||
Thread | Thread Starter | Forum | Replies | Last Post |
![]() |
Catty | Word VBA | 1 | 05-05-2014 03:42 AM |
![]() |
Amapola188 | Word VBA | 3 | 07-12-2012 05:16 PM |
Macro to insert new page... | samanthaj | Word | 17 | 01-31-2012 01:53 PM |
![]() |
faramir | Word VBA | 4 | 11-16-2011 05:43 AM |
![]() |
Shafraz Khahir | Word | 1 | 11-29-2010 11:52 AM |