Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 09-21-2016, 01:28 AM
Welshgasman Welshgasman is offline Amend text shape in header with VBA Windows 7 32bit Amend text shape in header with VBA Office 2003
Novice
Amend text shape in header with VBA
 
Join Date: Jun 2011
Posts: 26
Welshgasman is on a distinguished road
Default

Paul,

The following code works great
Code:
For Each sh In ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes
            If sh.Type = msoTextBox And sh.Name = "Text Box 1" Then
                'sh.TextFrame.TextRange.Text = Replace(sh.TextFrame.TextRange.Text, "The Business Centre", "JAG Business Centre")
                'sh.TextFrame.TextRange.Paragraphs.Alignment = wdAlignParagraphRight
                sh.TextFrame.MarginLeft = 0 'This puts the text right on the margin
                sh.TextFrame.TextRange.Font.Name = "Arial"
                sh.TextFrame.TextRange.Font.Size = 10
                sh.TextFrame.AutoSize = True
                sh.TextFrame.TextRange.Text = strText
            End If
            
        Next sh
but as I suspected I need to autosize the header height for the new font size

How would I do that please. I've tried looking in the properties, but have yet to find the correct value.

TIA
Reply With Quote
 

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
selecting shape in header only mhagi Word VBA 5 10-09-2015 01:10 AM
Get the TEXT of Clicked Shape exceere Excel Programming 9 07-09-2014 06:51 AM
Amend text shape in header with VBA how to paste text as shape bsapaka Excel 1 05-01-2014 06:53 AM
Amend text shape in header with VBA Excel vba adding field in word table/shape in a header Hdr Excel 1 02-04-2013 04:40 PM
Amend footer in multiple word docs? compact Word 2 02-24-2009 09:40 AM

Other Forums: Access Forums

All times are GMT -7. The time now is 10:29 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2025, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2025 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft