I'm developing macro for a news paper in ms publisher. It seems that "grow textbox to fit text" option is not working on next linked textbox, but I founded a manual trick which is:
- set focus on first textbox
- press Ctrl+end button to reach the cursor to end of textbox
- press Ctrl+Shift+Down arrow key
- Ctrl+Shift+End to Select nextlinked textbox's remaining text
- press Ctrl+X to cut it and then break Link of first textbox
- select second textbox and press Ctrl+v to paste cut text into second textbox
- then set "grow textbox to fit text" option in formate tab.
It is easy and testable for you in manual steps, but would be amazing if someone could help me to do same steps with vba macro coding.
I repeat steps for macro target:
- go to end of first textbox's text
- then select remaining text of story which is in other textbox linked with first
- then cut selected text
- then break link
- then past cut-ed text into second textbox
- then set "grow textbox to fit text" in format textbox --text autofitting.
I'm successful in linking textboxes in vba which is as:
ActiveDocument.Pages(1).Shapes(1).TextFrame.NextLinkedTextFrame = ActiveDocument.Pages(1).Shapes(2).TextFrame
ActiveDocument.Pages(1).Shapes(2).TextFrame.AutoFitText = pbTextAutoFitShrinkOnOverflow
I want to make automatic newspaper macro.