+ Reply to Thread
Results 1 to 2 of 2

Hiding a content control image with userform selection in Word

  1. #1
    Registered User
    Join Date
    01-18-2025
    Location
    Australia
    MS-Off Ver
    Office 365
    Posts
    1

    Hiding a content control image with userform selection in Word

    Hi all,

    I'm pretty new to VBA and I'm currently trying to include a feature in my Word document which will hide a content control image when a button on the userform is clicked but I'm unsure of the correct code to achieve this. I've been able to accomplish this with my content control text however trying this with an image results in endless errors no matter how many variations I try.

    When I macro record the creation of the content control image I want to manipulate it shows "Selection.Range.ContentControls.Add (wdContentControlPicture)" and adding a title returns "Selection.ParentContentControl.Title = "TitleOne".

    I can't seem to find any examples online of this specific issue.

  2. #2
    Forum Expert macropod's Avatar
    Join Date
    12-22-2011
    Location
    Canberra, Australia
    MS-Off Ver
    Word, Excel & Powerpoint 2003 & 2010
    Posts
    3,842

    Re: Hiding a content control image with userform selection in Word

    You could, for example, reduce the image size. For example:
    Please Login or Register  to view this content.
    will reduce the height to 0.01pt. to restore it, simply change the .Height value back to whatever you'd prefer it to be.
    Cheers,
    Paul Edstein
    [Fmr MS MVP - Word]

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. [SOLVED] Userform Image Control - Show specific region of Image
    By PrizeGotti in forum Excel Programming / VBA / Macros
    Replies: 11
    Last Post: 11-09-2021, 12:04 PM
  2. Userform with image control.
    By Trond64 in forum Excel Programming / VBA / Macros
    Replies: 20
    Last Post: 04-18-2021, 06:00 AM
  3. Get Image from worksheet to UserForm Image Control
    By sijostephen in forum Excel Programming / VBA / Macros
    Replies: 3
    Last Post: 02-17-2020, 06:54 AM
  4. Generic Sub for Image control in Userform
    By smjjvh in forum Excel Programming / VBA / Macros
    Replies: 13
    Last Post: 08-15-2014, 05:46 PM
  5. [SOLVED] How to apply Image borders to an image that my excel vba userform pastes in a word doc?
    By CaptainCool in forum Excel Programming / VBA / Macros
    Replies: 6
    Last Post: 05-11-2014, 05:40 PM
  6. [SOLVED] VBA to transfer image FROM userform image control TO a worksheet cell
    By Zoediak in forum Excel Programming / VBA / Macros
    Replies: 1
    Last Post: 04-01-2014, 02:51 PM
  7. VBA/Word picture content control causing unreadable content
    By atycks in forum Excel Programming / VBA / Macros
    Replies: 0
    Last Post: 01-15-2013, 04:51 PM

Bookmarks

Posting Permissions

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

Search Engine Friendly URLs by vBSEO 3.6.0 RC 1