Consulting

Results 1 to 2 of 2

Thread: Publisher text box not changing all the font

  1. #1

    Publisher text box not changing all the font

    When creating a text box in publisher (form access) I noticed when trying to change the font and size, only some of the text changed. I had to put a for loop in to run the code a few times and this seems to work. Does anyone know it doesn't work fully on the first pass?

    Set ShpTB = DocPub.Pages(2).Shapes.AddTextbox _(Orientation:=pbTextOrientationHorizontal, _
    Left:=122, Top:=702.8, _
    Width:=horzwidth, Height:=55)
    DocPub.Pages(2).Shapes("Text Box " & 1).TextFrame.TextRange.Text = exceptiontext
    
    
    With ShpTB
    For x = 1 To 25 'need to repeat this as doesn't change all text unless repeated for some reason
    .TextFrame.TextRange.Font.Size = 8
    .TextFrame.TextRange.Font.Name = "Tahoma"
    Next x
    End With

  2. #2
    VBAX Regular
    Joined
    Nov 2020
    Location
    Swansea,South Wales,UK
    Posts
    90
    Location
    Well a quick Google seems to confirm what I thought how it should work?
    You need to select the text first?
    https://docs.microsoft.com/en-us/off...textrange.font

Posting Permissions

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