Post Reply 
 
Thread Rating:
  • 0 Votes - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Automating msword to extract the email id from several records to exelsheet
02-07-2012, 03:07 PM
Post: #1
Rolleyes Automating msword to extract the email id from several records to exelsheet

Hi iam looking for the way to get the email id from the msword document to execl file
iam having several files of customers in a folder called records where i need to automate msword to get email id of customers into an exel file.


i run the below script but iam getting errors.....plz help

Set wrdApp = CreateObject(“Word.Application”)
Set wrdDoc = wrdApp.Documents.Open(“C:\Records\abc.doc”)

searchString = “@gmail.com”

With wrdDoc
For p = 1 To .Paragraphs.Count
startRange = .Paragraphs(p).Range.Start
endRange = .Paragraphs(p).Range.End
Set tRange = .Range(startRange, endRange)
‘ tString = tRange.Text
tRange.Find.Text = searchString
tRange.Find.Execute

Next
.Close ‘ close the document
End With
wrdApp.Quit ‘ close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
Find all posts by this user
Quote this message in a reply
02-07-2012, 07:31 PM
Post: #2
RE: Automating msword to extract the email id from several records to exelsheet
(02-07-2012 03:07 PM)narasimha Wrote:  Hi iam looking for the way to get the email id from the msword document to execl file
iam having several files of customers in a folder called records where i need to automate msword to get email id of customers into an exel file.


i run the below script but iam getting errors.....plz help

Set wrdApp = CreateObject(“Word.Application”)
Set wrdDoc = wrdApp.Documents.Open(“C:\Records\abc.doc”)

searchString = “@gmail.com”

With wrdDoc
For p = 1 To .Paragraphs.Count
startRange = .Paragraphs(p).Range.Start
endRange = .Paragraphs(p).Range.End
Set tRange = .Range(startRange, endRange)
‘ tString = tRange.Text
tRange.Find.Text = searchString
tRange.Find.Execute

Next
.Close ‘ close the document
End With
wrdApp.Quit ‘ close the Word application
Set wrdDoc = Nothing
Set wrdApp = Nothing
what error messages?

Basanth
QTP On Unix- Java Way - Without Putty or Terminal Emulation
You have no idea how high I can fly...
Find all posts by this user
Quote this message in a reply
Post Reply 


Forum Jump:


User(s) browsing this thread: 1 Guest(s)