Results 1 to 4 of 4
  1. #1
    Tinakarori
    Guest

    Default MS Word: how do I embed an object inside a text box

    I want to embed an Excel workbook *inside* a Word text box, but have been unsuccessful so far despite following the Help instructions. (Don't ask why: the objectives would only interest management accountants...... all right, I'll explain: it's part of setting up a semi-automated monthly performance reporting format)

    I can simply embed the required section/area of the workbook in the ordinary body of the document, no problem, but it doesn't work when I try to do the same thing within a text box.

    The reason for placing the Excel object inside a text box, rather than in the body of the document, is to facilitate users' movement from place to place in the format, i.e. the bits they should review and update. If these sections are each located inside a text box, I can include "Move to next Box" and other helpful document navigation buttons on the custom toolbar I have built for the format.

  2. #2
    godfather
    Guest

    Default Re: MS Word: how do I embed an object inside a text box

    Works for me in Excel 2003.
    What version are you using?

  3. #3
    parry
    Guest

    Default Re: MS Word: how do I embed an object inside a text box

    Theres TextBoxes and TextBoxes. From which toolbar did you draw it? If you use a textbox object from the drawing toolbar you can do this but not from a TextBox control from either the Visual Basic or Control Toolbox toolbars.

    However, I would just use a bookmark for each location and a button to go backwards and forwards to the next bookmark.

  4. #4
    parry
    Guest

    Default Re: MS Word: how do I embed an object inside a text box

    Theres probably easier ways to do this but I dont know the Word object model well enough.

    1. open the VBE (Alt+F11)
    2. Insert a Module (Insert|Module)
    3. Paste the code below in the right hand window
    4. Close the VBE (Alt+Q)

    Create two buttons on your toolbar to go backwards and forwards between bookmarks - eg one called Next Bookmark and the other one called Previous Bookmark.

    Assign the NextBkMark macro to the Next Bookmark button and the PrevBkMark macro to the Previous Bookmark button.

    [pre]Public BkmkArr
    Public CurBkmk As String[/pre]


    [pre]Sub NextBkMark()
    Dim TotalBkmks, i As Integer

    TotalBkmks = ActiveDocument.Bookmarks.Count

    If CurBkmk = "" Then
    ActiveDocument.Bookmarks(1).Select
    CurBkmk = ActiveDocument.Bookmarks(1).Name
    Exit Sub
    End If

    For Each bkmk In ActiveDocument.Bookmarks
    i = i + 1
    If bkmk.Name = CurBkmk Then Exit For
    Next bkmk

    If i + 1 > TotalBkmks Then
    MsgBox "You're at the last bookmark!"
    Else
    CurBkmk = ActiveDocument.Bookmarks(i + 1).Name
    ActiveDocument.Bookmarks(i + 1).Select
    End If

    End Sub[/pre]

    [pre]Sub PrevBkMark()
    Dim TotalBkmks, i As Integer

    TotalBkmks = ActiveDocument.Bookmarks.Count

    If CurBkmk = "" Then
    ActiveDocument.Bookmarks(1).Select
    CurBkmk = ActiveDocument.Bookmarks(1).Name
    Exit Sub
    End If

    For Each bkmk In ActiveDocument.Bookmarks
    i = i + 1
    If bkmk.Name = CurBkmk Then Exit For
    Next bkmk

    If i - 1 < 1 Then
    MsgBox "You're at the first bookmark!"
    Else
    CurBkmk = ActiveDocument.Bookmarks(i - 1).Name
    ActiveDocument.Bookmarks(i - 1).Select
    End If

    End Sub[/pre]

Similar Threads

  1. MS Word - putting picture into a text box
    By caffy in forum PressF1
    Replies: 6
    Last Post: 26-04-2007, 05:10 PM
  2. Word - Text wrap around graphic
    By Scouse in forum PressF1
    Replies: 8
    Last Post: 06-12-2005, 07:51 PM
  3. Can I bottom-align text in a Word text box?
    By Billy T in forum PressF1
    Replies: 5
    Last Post: 21-05-2004, 11:14 PM
  4. TEXT BORDERS IN WORD 2000 (NOT TEXT BOXES)
    By Karen Grant in forum PressF1
    Replies: 2
    Last Post: 04-02-2003, 01:01 PM
  5. Excel - Word/text functions
    By in forum PressF1
    Replies: 6
    Last Post: 25-06-2001, 04:07 PM

Posting Permissions

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