PDA

View Full Version : Word To Excel help



Emoncada
03-25-2010, 08:36 AM
I have the script below that has worked good, but now want to add two radio buttons for a yes and no question. Can someone assist please.
What I want is if

OPButtonYes = True then just to pull the value of a cell and put it in word something like this.
If OPButtonYES.Value = True Then
.formfields("Loopback_0_IPMa").result = ws.Range("B9").Value

Now if OPButtonNO = True Here is where Im stuck.

I want it delete a few form fields something like this
If OPButtonNO.Value = True Then
delete .formfields("Ma_line1")
delete .formfields("Ma_line2")
delete .formfields("Ma_line3")

etc.. until .formfields("Ma_line10")


Here is a few lines of code that works pulling data from word and put's it in excels form fields.


With wd
.formfields("site_id").result = ws.Range("b3").Value
.formfields("Branch_Name").result = ws.Range("B4").Value
.formfields("Street").result = ws.Range("B5").Value
.formfields("City").result = ws.Range("B6").Value
.formfields("State").result = ws.Range("B7").Value
.formfields("Zip").result = ws.Range("B8").Value


Any help would be great.

Thanks

lucas
03-25-2010, 11:39 AM
If you're not using the formfields for input directly into the word document you could use bookmarks instead and just leave them.

They aren't visible as formfields are.

Emoncada
03-25-2010, 03:01 PM
Im using Text Form Fileds with "Default Text" for each one and each one has a bookmark.

I have some rows of text that If No is selected I want deleted and everything move up not just blank or empty.

Can this be done?

Emoncada
03-30-2010, 05:28 AM
BUMP!

SamT
03-30-2010, 07:20 AM
Maybe?


formfields("Ma_line1").Delete
etc