Results 1 to 4 of 4
  1. #1
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Toggle Picture under a Table in Headers (Office XP, Word 2000)

    In my templates I have a table and a logo (a picture) in the header. The table will contain some text inserted with CustomProperties using a macro.

    The Logo is a picture to be visible across the page (may be behind the table?) The text in the table shall always will be printed (on top of the picture). Also I need to toggle the picture visible/not visible, but the text shall always be visible.

    Earlier I got this macro from Woody's, which is functioning very well:

    Sub ToggleLogosOnOff()
    Dim cmdToggleLogosText As String
    Dim sec As Section
    Dim hdr As HeaderFooter
    Dim fld As Field
    Dim rng As Range

    For Each sec In ActiveDocument.Sections
    For Each hdr In sec.Headers
    Set rng = hdr.Range
    For Each fld In rng.Fields
    If fld.Type = wdFieldIncludePicture Then
    With fld.InlineShape.Range.Font
    .Hidden = Not .Hidden
    End With
    End If
    Next fld
    Next hdr
    Next sec
    If cmdToggleLogosOnOff.Caption = "Hide Logos" Then
    cmdToggleLogosOnOff.Caption = "Show Logos"
    ActiveDocument.CustomDocumentProperties("LOGOSVISI BLE") = False
    Else
    cmdToggleLogosOnOff.Caption = "Hide Logos"
    ActiveDocument.CustomDocumentProperties("LOGOSVISI BLE") = True
    End If

    Set fld = Nothing
    Set rng = Nothing
    Set hdr = Nothing
    Set sec = Nothing
    End Sub

    This logo was placed in a cell in the table. But how can I show and hide a logo; a picture, that covers the table and be visible under the table text?

    The picture contains a logo on top of a shaded area. It is the shaded area that must be behind the text.

    I am attaching a dot -file (zip-file) where the shaded area is in the table, but if the shaded area is in the same picture as the logo the solution must be different.

    Hope I have explained myself good enough and that it is possible to solve it.

    Thanks in advance

    bjoeng/Bjorn
    Attached Files Attached Files

  2. #2
    Plutonium Lounger
    Join Date
    Mar 2002
    Posts
    84,353
    Thanks
    0
    Thanked 29 Times in 29 Posts

    Re: Toggle Picture under a Table in Headers (Office XP, Word 2000)

    Your logo is currently an inline picture; make it floating as follows:
    - Activate the header.
    - Select the logo.
    - Select Format | Picture...
    - Activate the Layout tab.
    - Select 'Behind text'.
    - Click OK.
    - Move the logo to the desired position and resize it if necessary.

    Adapt the code in the ToggleLogosOnOff procedure. Replace For Each fld In rng.Fields ... Next fld by

    Dim i As Long
    For i = 1 To rng.ShapeRange.Count
    With rng.ShapeRange(i)
    .Visible = Not .Visible
    End With
    Next i

  3. #3
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Toggle Picture under a Table in Headers (Office XP, Word 2000)

    Thanks Hans!!


    I appreciate the good and quick answers very much!!!

    I will try this to night.

    Bjorn

  4. #4
    3 Star Lounger
    Join Date
    Jul 2001
    Location
    ASKER, Norway
    Posts
    277
    Thanks
    6
    Thanked 0 Times in 0 Posts

    Re: Toggle Picture under a Table in Headers (Office XP, Word 2000)

    Thanks Hans!

    It just worked perfect!

    Bjorn

Posting Permissions

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