Results 1 to 3 of 3
  1. #1
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    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. #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.

  3. #3
    Star Lounger
    Join Date
    May 2009
    Posts
    84
    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
  •