Search for text box formatted to Layout: In line with text

MS WORD

    Next

  • 1. Printing to paper trays
    I have posted this problem to the PAge Layout forum but I first encountered it with VBA. I am having a problem with paper trays, re the following: - in a new document type some text, put in a next page section break and type some text on page 2 (section 2) - In File, Page Setup choose Tray One for first page and Tray Two for the other pages, making sure you've got apply to Whole Document seleceted - if you then print the document, both pages come from tray 1!!. If you look in File Page, Setup again it has first page from tray 1 and other pages from tray 2 for This Section, but if you change it to Whole Document no trays are selected. If seems to print the first page of each section from tray 1 and the rest of the pages from each each section from tray 2. As each section only has 1 page they all print from tray 1. Is this true and how do I get around it? This VBA code seems to do the same thing as manually changing the trays in Word: ActiveDocument.PageSetup.FirstPageTray =somecode working out tray ActiveDocument.PageSetup.OtherPagesTray = somecode working out tray
  • 2. Remembering Values
    Hi I have created a user form for memos and faxes. I would like to be able to remember the last 4 recipient details entered. Initially I thought of creating 4 documents, each with a name and job title bookmark, when i click button number 1 on my user form it would look in document1 read the bookmark values and pop them into the text boxes in the user form. If the user overtypes the text in the text boxes it rewrites the text in the bookmarks in the relevant document. I can't seem to find any mention of how to read bookmark values - do I need to use something else?? would autotext or a table or even excel be any easier for storing data. I would really appreciate some advice. Thank you very much for your time. Kerry.
  • 3. macro/form to prompt user for input (in WORD)
    Simple request: Want to create macro/form to prompt user to imput a "word". This word will then be placed on a formated page that allows fifteen different words/phrases arranged in three columns, five rows. These can be printed out to create flash cards for language study. By having an input box, it eliminates all of the tabbing & entering to put these words in the correct place on the page. KNOW it's possible & simple. Can't remember enough about creating a macro to do it and the macro directions in Word just don't apply at all. Thanks!

Search for text box formatted to Layout: In line with text

Postby RGFuIEI » Thu, 21 Feb 2008 21:15:02 GMT

Hi.

I've managed to set up a macro that hides the content of all text boxes in 
my document by searching for each text box and setting the contents' font 
colour to white.  However, it only seems to find text boxes that haven't been 
formatted to 'Layout: In line with text'.

Does anybody know way to search for and edit these text boxes as well as the 
others?

Here is the code that I am using:

Sub HideAnswers()

' Find each text box and set it's font colour to white

Dim aShape As Shape

For Each aShape In ActiveDocument.Shapes

   If aShape.Type = msoTextBox Then

      aShape.Select
      Selection.Font.Color = wdColorWhite
      
   End If

Next

End Sub

Any help would be really appreciated.

Cheers,

Dan.


Re: Search for text box formatted to Layout: In line with text

Postby Stefan Blom » Thu, 21 Feb 2008 22:28:33 GMT

I'm guessing the problem is caused by your attempt to select the text. Use 
this code instead:

Sub HideAnswers()

Dim aShape As Shape

For Each aShape In ActiveDocument.Shapes

   If aShape.Type = msoTextBox Then

      'Set the font color directly for each text box shape:
      aShape.TextFrame.ContainingRange.Font.Color = wdColorWhite

   End If

Next

End Sub


-- 
Stefan Blom
Microsoft Word MVP











RE: Search for text box formatted to Layout: In line with text

Postby SmVhbi1HdXkgTWFyY2ls » Thu, 21 Feb 2008 22:29:02 GMT




Normally, inLine shapes and floating shapes are two different collections. 
You would have to iterate both of them. But, textboxes are different, even 
when inline they retain their "Shape" status. However, your usage of the 
Selection object is causing you grief. Only use the Selection object when you 
must (i.e. there is no other way of achieveing a result).

Try this variation of your code:

Dim aShape As Shape

For Each aShape In ActiveDocument.Shapes
    If aShape.Type = msoTextBox Then
        With aShape
            If .TextFrame.HasText Then
                .TextFrame.TextRange.Font.Color = wdColorWhite
            End If
        End With
    End If
Next

Re: Search for text box formatted to Layout: In line with text

Postby SmVhbi1HdXkgTWFyY2ls » Thu, 21 Feb 2008 23:19:01 GMT



Just in case DanB (or other readers) does not know the difference between 
our two suggestions I thougth I'd clarify a small technical point...
You used the .ContainingRange property which refers to the entire range of 
text inside linked textboxes. I use the .TextRange property which refers to 
the individual range of text inside each textbox, whether they are linked or 
not. In this case, the only difference in the application is that if there 
are, let's say, 3 linked textboxes, the code with the .ContainingRange 
Property will apply the white font colour three times to the text inside the 
linked textboxes. So, in this case, it does not matter which property one 
uses, but with some other scenario, it might make a big difference!

Re: Search for text box formatted to Layout: In line with text

Postby Stefan Blom » Fri, 22 Feb 2008 21:33:06 GMT

Of course, generally it makes more sense to use .TextRange, since it returns 
the range of a *specific* shape (excluding the ranges of any linked 
shapes/text boxes). Thank you for adding this clarification.

-- 
Stefan Blom
Microsoft Word MVP












Similar Threads:

1.Text boxes keep moving after Format:Text Box:Layout:Advanced:

I'm using Word 2008 (12.1.5), OS X 10.5.6.  I am trying to having two-column 
text flow around tables and figures that I place in text boxes that I am 
trying to anchor.  After inserting and formatting the text boxes, I find that 
revisions to certain text, or changing the spacing between certain  text 
boxes and the text causes the text box to 'jump' to another page.  Only 
certain text boxes seem to be 'volatile', but I cannot discern what setting I 
may have implemented to cause this.

I use the Format:Text Box:Layout:Advanced path  and set the text boxes with 
absolute measurements relative to the margins.  I have been activating the 
'Lock Anchor' option, but no other option.  I do not activate the 'Move 
object with Text' option.  I cannot detect any sign that I inadvertantly 
formatted the text to affect the text box position.  I cannot extract any 
help from the Help.

2.change the layout of the text boxs via format text box window

Engin

"jeffrey" < XXXX@XXXXX.COM > wrote in message 
news: XXXX@XXXXX.COM ...
>
> -- 
> jew 


3.Text box formatting moves text box

In normal Word usage I can change the text margins and size of a text box 
using the Format Text Box dialogue and the text box stays in the same 
position. However, when I try to do the same operations while recording a 
macro the text box gets moved to the top left corner of the page when I click 
on OK. How can I stop this happening, or at least edit the macro so the 
position of the text box is not altered?

Grateful for assistance.

4.How do I stop text in text boxes affecting text in other text box

I create family trees using text boxes in Word.  I have a text box on page 1 
which seems to be connected mysteriously to a text box on page 15.  Whatever 
I type in either one comes up in the other. Are they linked? How? Can I stop 
it?  

5.Typing text is impossibly slow in text boxes when in publishing layout

Version: 2008
Operating System: Mac OS X 10.6 (Snow Leopard)
Processor: Intel

When I try to type or edit text in a text box in a template document (a newsletter template) the typing, editing, deleting, backspacing or what ever, is absolutely impossibly slow.  Am I doing something wrong or do I have something set up wrong.  If it remains this way I will not be able to work in this program.

6. layout wrapping text around text boxes in word 2000

7. Displaying Text With Layout in a Text Box

8. Searching for text in Text boxes



Return to MS WORD

 

Who is online

Users browsing this forum: No registered users and 30 guest