Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 03-14-2022, 11:40 PM
Guessed's Avatar
Guessed Guessed is offline Using textframe value in comparison Windows 10 Using textframe value in comparison Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,160
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

The most logical thing is not to select it in the first place
Code:
Sub TestMacro()
  Dim shp As Shape, aRng As Range
  For Each shp In ActiveDocument.Sections(1).Headers(wdHeaderFooterPrimary).Shapes
    If shp.Type = msoTextBox Then
        Set aRng = shp.TextFrame.TextRange
        aRng.MoveStart Unit:=wdCharacter, Count:=1
        aRng.Font.Subscript = True
    End If
  Next
End Sub

__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #2  
Old 03-15-2022, 12:16 AM
Scaffold Scaffold is offline Using textframe value in comparison Windows 10 Using textframe value in comparison Office 2016
Advanced Beginner
Using textframe value in comparison
 
Join Date: Oct 2009
Location: Moscow, Russia
Posts: 36
Scaffold is on a distinguished road
Default

Quote:
Originally Posted by Guessed View Post
The most logical thing is not to select it in the first place
This is one big mighty "Oops"! I normally program with C# and for the different API. I'm struggling with the MS Office API.
Thank you very much! This solves it for me.
Reply With Quote
Reply



Similar Threads
Thread Thread Starter Forum Replies Last Post
Document Comparison Thefirstfish` Word VBA 0 04-10-2017 01:07 PM
Comparison (with styles) Macro aarona Word VBA 0 03-03-2017 11:18 PM
Saving & reopening comparison MarshallAbrams Word 0 03-29-2012 06:19 AM
Comparison jumps to end MarshallAbrams Word 2 03-21-2012 04:04 AM
Using textframe value in comparison oshp.TextFrame.TextRange.Font <The specified error is out of range> ghumdinger PowerPoint 5 12-09-2011 10:36 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 09:37 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