#1
|
|||
|
|||
anchor addtextbox to new page
Problem: Coordinates for Textbox do not update when the focus moves to the 2nd and subsequent pages.
The documentation on AddTextbox does mention use of an Anchor, but with no example. Previous use of an Anchor for AddPicture kindly devised in a reply by macropod on 3 Dec 2014 gave me this code which works fine to locate a picture on the correct page; the code also adds a pagebreak from the previous page. Code:
Dim Rng As Range With ActiveDocument Set Rng = .Range With Rng .Collapse direction:=wdCollapseEnd .InsertBreak Type:=wdPageBreak .Collapse direction:=wdCollapseEnd End With .Shapes.AddPicture LinkToFile:=False, Anchor:=Rng, _ FileName:="C:\somefilename.bmp", _ SaveWithDocument:=True, Left:=300, Top:=1, Width:=100, Height:=100 End With ActiveDocument.Shapes.AddTextbox(msoTextOrientatio nHorizontal, 74, 92, 282, 24, xxxxxx) - this is what the "Help" tells me is how to anchor the AddTextbox. xxxxx is the anchor, but I have failed to find a syntax that works for this instruction. The VBA "Help" could be a lot better on things like this so I am very thankful for this forum. So how do you set up an Anchor for Textboxes please? Last edited by macropod; 12-05-2014 at 01:52 AM. Reason: Added code tags & formatting |
#2
|
||||
|
||||
The code is essentially the same:
Code:
Dim Rng As Range With ActiveDocument Set Rng = .Range With Rng .Collapse direction:=wdCollapseEnd .InsertBreak Type:=wdPageBreak .Collapse direction:=wdCollapseEnd End With .Shapes.AddTextbox Orientation:=msoTextOrientationHorizontal, _ Left:=74, Top:=92, Width:=282, Height:=24, Anchor:=Rng End With
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
Tags |
addtextbox, anchor, newpage |
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Link or Anchor Drawings to Text | RayLab | OneNote | 6 | 01-07-2015 12:30 PM |
anchor a frame so it wont move. | blockie | Drawing and Graphics | 2 | 08-17-2014 07:06 AM |
Page layout: skipping one page for new elements added at end of a page | MarcA | Word | 3 | 09-30-2013 02:58 PM |
2 page document printing problem, text from page 1 in layout of page 2 when printed | laurawether45 | Word | 1 | 08-02-2012 07:03 AM |
Text boxes don't anchor properly in PPT '08 | noni | PowerPoint | 0 | 11-13-2011 09:16 AM |