Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
Regular expressions in VFP
Message
From
09/10/2008 14:37:25
 
 
To
09/10/2008 14:10:36
General information
Forum:
Visual FoxPro
Category:
COM/DCOM and OLE Automation
Environment versions
Visual FoxPro:
VFP 9
OS:
Vista
Network:
Windows XP
Database:
Visual FoxPro
Miscellaneous
Thread ID:
01353849
Message ID:
01353896
Views:
28
oDoc = oWord.oDocuments.Open(....)
cContent = oDoc.Content()

gives me the text

there could be some stuff prior to the date and address
but somewhere there is a date and then the name/address like:

....
October 9,2008

Mr Tore Bleken
123 Fjord Bld.
Stokke, CT 06279



dear....


......
.....
.....

and so on

cContent gets placed into a memo field
once I get the name I can redo it into lastname, fisrtname

locate it in the contacts table, get the id and update the cletters table with the contact_id

and so on

the tricj is finding the name/address in the content
if i COULD at least find the date with a regex I could do the rest fairly easyly
Peter

>If I understand correctly, you have these lines after each other in the letter:
>Date
>Name
>Address1
>Address2
>Address3
>
>If the date format is fixed, you can convert the letters, one by one, to a text file. Create a cursor with structure c(255), and append from the text file. Scan the cursor, and find the record which contains a legal date. The next record is the name you are looking for.
>
>
>>July 12, 2007
>>
>>if i can find this I would be all set, because the name and address comes after it
>>
>>Peter
>>
>>>Hi,
>>>
>>>Not neccessarily impossible - though likely not to be easy.
>>>
Peter Cortiel
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform