Consulting

Results 1 to 3 of 3

Thread: How do I put insert Linebreak

  1. #1
    VBAX Regular Erays's Avatar
    Joined
    Mar 2005
    Posts
    73
    Location

    How do I put insert Linebreak

    Sub HeyLetter()
    Dim Word                As Object
        Dim fSlash As String, dAddy As String
        fSlash = Application.PathSeparator
        dAddy = Environ("userprofile") & "\Desktop\"
    '-- Begin the Word setup
    Application.ScreenUpdating = False
        Set Word = CreateObject("Word.Basic")
        Word.FileNewDefault
        Word.AppShow
        Word.FormatFont Font:="Courier New", Points:=12
        Word.Bold 1
        Word.FormatParagraph Alignment:=0
        Word.Insert " Hey I just wanted to say have a nice weekend.  "
        Word.Insert (I would like to insert a Line break here)
        Word.Insert " My Name"
        Word.InsertPara
        Word.FormatFont Font:="Courier New", Points:=10
        Word.Bold 0
        Word.FormatParagraph Alignment:=0
        Application.ScreenUpdating = True
    End Sub

  2. #2
    VBAX Regular
    Joined
    Sep 2004
    Location
    Perth, Western Australia
    Posts
    20
    Location
    try

    Sub HeyLetter()
    Dim Word                As Object
        Dim fSlash As String, dAddy As String
        fSlash = Application.PathSeparator
        dAddy = Environ("userprofile") & "\Desktop\"
    '-- Begin the Word setup
    Application.ScreenUpdating = False
        Set Word = CreateObject("Word.Basic")
        Word.FileNewDefault
        Word.AppShow
        Word.FormatFont Font:="Courier New", Points:=12
        Word.Bold 1
        Word.FormatParagraph Alignment:=0
        Word.Insert " Hey I just wanted to say have a nice weekend.  "
        Word.Insert Chr(10)
        Word.Insert " My Name"
        Word.InsertPara
        Word.FormatFont Font:="Courier New", Points:=10
        Word.Bold 0
        Word.FormatParagraph Alignment:=0
        Application.ScreenUpdating = True
    End Sub
    Kieran

  3. #3
    VBAX Regular Erays's Avatar
    Joined
    Mar 2005
    Posts
    73
    Location
    Thank you now it works just fine

Posting Permissions

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