Microsoft Office Forums

Go Back   Microsoft Office Forums > >

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #5  
Old 07-18-2019, 05:25 PM
Guessed's Avatar
Guessed Guessed is offline Identify current column on a page Windows 10 Identify current column on a page Office 2016
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 4,184
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

It appears you are going off down rabbit holes instead of addressing your actual requirement
Quote:
Originally Posted by sts023 View Post
I wish to insert three lines of text at the bottom of the first column on page 2, in a formatted box.
The following macro will move the contents of the current paragraph into a coloured box at the bottom of the first column on the current page. You could modify that to suit your specific requirements
Code:
Sub AddACallout()
  Dim aRange As Range, aShape As Shape, sCallout As String
  Dim bLeft As Boolean, i As Integer, sPath As String, iWidth As Integer
  
  iWidth = Selection.Sections(1).PageSetup.TextColumns(1).Width
    
  'Must be in Page Layout view for macro to show effect
  If ActiveWindow.View.SplitSpecial = wdPaneNone Then
    ActiveWindow.ActivePane.View.Type = wdPrintView
  Else
    ActiveWindow.View.Type = wdPrintView
  End If

  If Selection.Paragraphs.Count > 1 Then
    Set aRange = Selection.Range
    aRange.Start = aRange.Paragraphs.First.Range.Start
    aRange.End = aRange.Paragraphs.Last.Range.End
  Else
    Set aRange = Selection.Paragraphs(1).Range
  End If
  sCallout = aRange.Text
  aRange.Text = ""

  Set aShape = ActiveDocument.Shapes.AddShape(Type:=msoShapeRectangle, Left:=0, Top:=2, Width:=iWidth, Height:=80, Anchor:=aRange)  'msoShapeRoundedRectangle
  With aShape
    .TextFrame.TextRange = Left(sCallout, Len(sCallout) - 1)
    .TextFrame.TextRange.Style = "Normal"
    .TextFrame.MarginTop = 0
    .TextFrame.MarginLeft = 4
    .TextFrame.MarginRight = 4
    .TextFrame.MarginBottom = 4
    .TextFrame.AutoSize = True
    .WrapFormat.Type = wdWrapSquare
    .WrapFormat.Side = wdWrapBoth
    .RelativeVerticalPosition = wdRelativeVerticalPositionBottomMarginArea
    .Top = -.Height
    .RelativeHorizontalPosition = wdRelativeHorizontalPositionMargin
    .Left = wdShapeLeft
    .Line.Visible = msoFalse
    .Fill.ForeColor = RGB(150, 230, 230)
  End With
End Sub
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
 

Tags
columns, count, information

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
Identify current column on a page Return nameof Left column in current view trevorc Excel Programming 7 09-19-2018 08:38 PM
Identify current column on a page Table adding cells to previous page with room still on current page. gedet Word 1 01-03-2018 10:35 AM
Identify last blank cell in column mbesspiata Excel 0 02-27-2015 11:29 AM
How to save the current page in a new file with all the page settings (header, footer Jamal NUMAN Word 6 03-15-2012 03:27 PM
Is there a way to automatically highlight the column and the row that of the current Jamal NUMAN Excel 8 02-14-2012 02:58 PM

Other Forums: Access Forums

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