Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    May 2009
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Example:

    ActiveDocument.Bookmarks("bmkDogs").Range.Text = "The Great Dane is " (insert hard or soft return in the document)

    "a noble breed."

    How is the code written to use one bookmark and spread the sentence over two lines in the document?

    Thank you!
    Charlie
    charlie6067

  2. Subscribe to our Windows Secrets Newsletter - It's Free!

    Get our unique weekly Newsletter with tips and techniques, how to's and critical updates on Windows 7, Windows 8, Windows XP, Firefox, Internet Explorer, Google, etc. Join our 480,000 subscribers!

    Excel 2013: The Missing Manual

    + Get this BONUS — free!

    Get the most of Excel! Learn about new features, basics of creating a new spreadsheet and using the infamous Ribbon in the first chapter of Excel 2013: The Missing Manual - Subscribe and download Chapter 1 for free!

  3. #2
    Super Moderator jscher2000's Avatar
    Join Date
    Feb 2001
    Location
    Silicon Valley, USA
    Posts
    23,112
    Thanks
    5
    Thanked 93 Times in 89 Posts
    I don't think you can do it in one step. Try:

    Code:
    Dim strNew As String
    strNew = "The Great Dane is " & vbCrLf & "a noble breed."
    With ActiveDocument
        .Bookmarks("dogs").Range.Text = strNew
        .Bookmarks("dogs").End = .Bookmarks("dogs").End + Len(strNew)
    End With
    == Edit ==

    If you don't need to expand the bookmark, then the code is simpler.

  4. #3
    Star Lounger
    Join Date
    May 2009
    Posts
    81
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Hi Jefferson - Many thanks for the fast reply. It's exactly what I need.

    Have a great weekend!
    Charlie
    charlie6067

Posting Permissions

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