Can I fill a form and archive it? Difficult project need help -

D

drsilicone

I have a magnetic swipe reader that fills a single cell in excel no problem
-- the problem is it outputs a long string with several fields of information
I need to separate and enter into a form.

Is it possible to sort that string and fill appropriate fields in a form
based in Word? How do I build such a field? How do I sort the data?

I really appreciate any help with this - thanks
 
D

Doug Robbins - Word MVP

If you to give us typical examples of the raw data and how you want them
separated, you would be more likely to get the help that you require.

--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 
D

drsilicone

%BCRICHMOND^BLOW, JOE JONATHON^205-12271 7 AVE$RICHMOND BC V5E
4X2^?;6363385816115=080219750324=?+E?


BC=province
RICHMOND=CITY
BLOW, JOE JONATHON=NAME
205-12271 7AVE=ADDRESS
RICHMOND BC V5E 4X2=CITY PROVINCE POSTAL_CODE
6363385816115=Drivers LICENSE
08021975=DDMMYYYY (birth date)

If I could have a word document with fields at the top that would be great.
The magnetic strip reader outputs data as an HID compliant USB device. There
is an option to have the reader act as a keyboard (stack?) but was advised
against that as the HID option keeps the input separate from possible
interfering key strokes.

The other field at the bottom of the document would be a signature field. I
understand after reading more about the signature pad that it has and SDK to
output a graphic or vector image into a word document though I'm still not
sure how to program an available field for that in word or excel -- there's
an identifier to the device and one should be able to assign that output to a
field??

Thanks for reading and any suggestions!!
 
D

Doug Robbins - Word MVP

The following macro will convert such a string into the format that you
want:

Dim myrange As Range, mrange As Range
Selection.HomeKey wdStory
Set myrange = Selection.Paragraphs(1).Range
Selection.Find.ClearFormatting
With Selection.Find
.Execute findText:="(%)([A-Z]{2})([A-Z]{1,})",
ReplaceWith:="\2=province^p\3=CITY", Replace:=wdReplaceAll,
MatchWildcards:=True, Forward:=True, Wrap:=wdFindContinue
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Execute findText:="^", ReplaceWith:="^p", Replace:=wdReplaceAll,
MatchWildcards:=False, Forward:=True, Wrap:=wdFindContinue
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Execute findText:="$", ReplaceWith:="^p", Replace:=wdReplaceAll,
MatchWildcards:=False, Forward:=True, Wrap:=wdFindContinue
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Execute findText:="^?;", ReplaceWith:="", Replace:=wdReplaceAll,
MatchWildcards:=False, Forward:=True, Wrap:=wdFindContinue
End With
Selection.HomeKey wdStory
Selection.Find.ClearFormatting
With Selection.Find
.Execute findText:="(=)([0-9]{8})([0-9]{1,}=?+E?)",
ReplaceWith:="=Drivers LICENSE^p\2=DDMMYYYY (birth date)",
Replace:=wdReplaceAll, MatchWildcards:=True, Forward:=True,
Wrap:=wdFindContinue
End With
Set mrange = myrange.Paragraphs(3).Range
mrange.End = mrange.End - 1
mrange.InsertAfter "=NAME"
Set mrange = myrange.Paragraphs(4).Range
mrange.End = mrange.End - 1
mrange.InsertAfter "=ADDRESS"
Set mrange = myrange.Paragraphs(5).Range
mrange.End = mrange.End - 1
mrange.InsertAfter "=CITY PROVINCE POSTAL_CODE"


--
Hope this helps.

Please reply to the newsgroup unless you wish to avail yourself of my
services on a paid consulting basis.

Doug Robbins - Word MVP
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top