alteration in msword2003 from vb6

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • disc
    New Member
    • May 2007
    • 3

    #1

    alteration in msword2003 from vb6

    hi all,
    pls help me in swapping of two words and also paragraphs and deleting a character in msword2003 through visual basic 6... i have done for deleting words.. please do help for the above...
    thank u
  • Dököll
    Recognized Expert Top Contributor
    • Nov 2006
    • 2379

    #2
    Originally posted by disc
    hi all,
    pls help me in swapping of two words and also paragraphs and deleting a character in msword2003 through visual basic 6... i have done for deleting words.. please do help for the above...
    thank u
    Hiya, disc!

    Please add what you've done thus far, if you wouldn't mind. I did some snooping around and could not find anything concrete, perhaps your code can help shed some light. How's that for a deal?

    Dököll
    Last edited by Dököll; May 19 '07, 02:43 AM. Reason: Text

    Comment

    • disc
      New Member
      • May 2007
      • 3

      #3
      Originally posted by Dököll
      Hiya, disc!

      Please add what you've done thus far, if you wouldn't mind. I did some snooping around and could not find anything concrete, perhaps your code can help shed some light. How's that for a deal?

      Dököll
      hi,
      thanks for the reply.well... below is some code ...hope that is enough to shed u full light!
      i am using vb6 and msword 2003

      Set wApp = New Word.Applicatio n
      'wApp.Visible = True
      Dim doc As Word.Document
      Set doc = wApp.Documents. Open("a.doc")
      doc.Words(a).Se lect //say a is 9 ie 9th word in word document
      'wApp.Selection .Delete

      please do reply soon
      thank u

      Comment

      • Dököll
        Recognized Expert Top Contributor
        • Nov 2006
        • 2379

        #4
        Originally posted by disc
        hi,
        thanks for the reply.well... below is some code ...hope that is enough to shed u full light!
        i am using vb6 and msword 2003

        Set wApp = New Word.Applicatio n
        'wApp.Visible = True
        Dim doc As Word.Document
        Set doc = wApp.Documents. Open("a.doc")
        doc.Words(a).Se lect //say a is 9 ie 9th word in word document
        'wApp.Selection .Delete

        please do reply soon
        thank u
        This just in, Disc, from a microsoft site example, you may need to copy an paste for additional words:

        Code:
        Private Sub SearchReplace()
            Application.Selection.Find.ClearFormatting()
            Application.Selection.Find.Text = "find me"
        
            Application.Selection.Find.Replacement.ClearFormatting()
            Application.Selection.Find.Replacement.Text = "Found"
        
            Application.Selection.Find.Execute(Replace:=Word.WdReplace.wdReplaceAll)
        End Sub
        Here's the link: http://msdn2.microsoft.com/en-us/lib...3d(VS.80).aspx

        Have fun!

        Comment

        • disc
          New Member
          • May 2007
          • 3

          #5
          hi,
          thank u.. well was quite usefull,
          aaa...but i didnt get what i needed..i meam swapping of paragraphs and words and deletion of charaters that should be done on word document (msword2003)thr ough vb6. if possible please try
          thanking u v much
          disc

          Comment

          Working...