
Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> I have read through all similar postings, but none quite fit.
>
[quoted text clipped - 16 lines]
>
> Thanks in advance
Thanks for your help so far, but it is not working properly. I have only
recorded macros before, never written the code, so I probably did something
wrong.
Here is what happens: The macro attempts to work, but it removes the data
from the bill-to fields, leaving them blank, and then does not write any data
to the ship-to fields, so I end up with all the fields blank. Then I get a
run-time error 5941 "the requested member of the collection does not exist"
when it tries to advance to the next field for manual entry again.
I have double checked the field names and they are all correct, so I'm not
sure what the problem is. Either way, that wouldn't answer the disappearing
data problem.
Here is my code. The last field should advance to a radio button - is that a
problem?
Sub OnExitSame()
Dim oFlds As FormFields
Set oFlds = ActiveDocument.FormFields
If oFlds("Same").CheckBox.Value = True Then
oFlds("ShopName").Result = oFlds("ShipTo").Result
oFlds("First").Result = oFlds("ShipToFirst").Result
oFlds("Middle").Result = oFlds("ShipToMiddle").Result
oFlds("Last").Result = oFlds("ShipToLast").Result
oFlds("HomeNo").Result = oFlds("ShipToHomeNo").Result
oFlds("WorkNo").Result = oFlds("ShipToWorkNo").Result
oFlds("CellNo").Result = oFlds("ShipToCellNo").Result
oFlds("Address").Result = oFlds("ShipToAddress").Result
oFlds("City").Result = oFlds("ShipToCity").Result
oFlds("State").Result = oFlds("ShipToState").Result
oFlds("Zip").Result = oFlds("ShipToZip").Result
oFlds("LiftGateYes").Select
Selection.Range.Fields(1).Result.Select
' Same Macro
' Macro recorded 8/4/2006 by CAC
End If
End Sub
Thanks so much, your help is greatly appreciated.
CAC
> Say the billing name field was named "BName" and the shipping name field is
> named "SName." You could run an on exit macro from the checkbox named
[quoted text clipped - 34 lines]
> >
> > Thanks in advance
Greg Maxey - 04 Aug 2006 20:53 GMT
E-mail me your document. You should be able to cipher out the spam proofing
in my address.

Signature
Greg Maxey/Word MVP
See:
http://gregmaxey.mvps.org/word_tips.htm
For some helpful tips using Word.
> Thanks for your help so far, but it is not working properly. I have only
> recorded macros before, never written the code, so I probably did
[quoted text clipped - 82 lines]
>> >
>> > Thanks in advance
AllYourSpam - 07 Aug 2006 20:02 GMT
See my e-mail with the same subject line. let me know if you don't get it.
Thanks CAC
> E-mail me your document. You should be able to cipher out the spam proofing
> in my address.
[quoted text clipped - 85 lines]
> >> >
> >> > Thanks in advance
Greg Maxey - 07 Aug 2006 21:20 GMT
As of 1620 today I didn't get it. The last three letters of the
address is org
> See my e-mail with the same subject line. let me know if you don't get it.
> Thanks CAC
[quoted text clipped - 100 lines]
> > >> >
> > >> > Thanks in advance
AllYourSpam - 08 Aug 2006 17:22 GMT
Yeah, I did get the .org part, but I will send the e-mail again. Thanks
> As of 1620 today I didn't get it. The last three letters of the
> address is org
[quoted text clipped - 103 lines]
> > > >> >
> > > >> > Thanks in advance
AllYourSpam - 11 Aug 2006 15:56 GMT
To anyone that is interested, Greg did help me with a solution. He is
Phenomenal!
Thanks Greg,
CAC
> Yeah, I did get the .org part, but I will send the e-mail again. Thanks
>
[quoted text clipped - 105 lines]
> > > > >> >
> > > > >> > Thanks in advance