vba to read first line in word doc and put it into inputbox

Author Message
dewajtis1

  • Total Posts : 28
  • Scores: 0
  • Reward points : 0
  • Joined: 7/25/2008
  • Status: offline
vba to read first line in word doc and put it into inputbox Saturday, November 08, 2008 4:16 PM (permalink)
0
Original message moved by ebgreen
Reason : Moved to proper forum
Hallo,
I have a code belowe. I want first line of text in word (which is always the same) to be read into inputbox.

Sub FindChange()
Dim myStoryRange As Range
Dim p As Paragraphs
Message = "Display text:"
Title = "Text"
Message_1 = "Display text:"
strText = InputBox(Message, Title)
repText = InputBox(Message_1, Title)

With Selection.Find
.Text = strText
.Replacement.Text = repText
.Forward = True
.Wrap = wdFindContinue
.Format = False
.MatchCase = False
.MatchWholeWord = False
.MatchWildcards = False
.MatchSoundsLike = False
.MatchAllWordForms = False
.Execute Replace:=wdReplaceAll
End With
End Sub
 
#1
    ebgreen

    • Total Posts : 8228
    • Scores: 98
    • Reward points : 0
    • Joined: 7/12/2005
    • Status: online
    RE: vba to read first line in word doc and put it into inputbox Monday, November 10, 2008 5:45 AM (permalink)
    0
    What currently happens? What is the problem? Are there errors?
    "... when you are good and crazy, oooh, oooh, oooh, the sky is the limit!" - The Tick
    Goog places to start:http://www.visualbasicscript.com/m_24727/tm.htm
    http://www.visualbasicscript.com/m_47117/tm.htm
     
    #2

      Online Bookmarks Sharing: Share/Bookmark

      Jump to:

      Current active users

      There are 0 members and 1 guests.

      Icon Legend and Permission

      • New Messages
      • No New Messages
      • Hot Topic w/ New Messages
      • Hot Topic w/o New Messages
      • Locked w/ New Messages
      • Locked w/o New Messages
      • Read Message
      • Post New Thread
      • Reply to message
      • Post New Poll
      • Submit Vote
      • Post reward post
      • Delete my own posts
      • Delete my own threads
      • Rate post

      2000-2012 ASPPlayground.NET Forum Version 3.9