jj98664
06-30-2015, 02:57 PM
New user to the site. Thanks for all the great help throughout the years.
My question is this:
I am trying to autofill an invoice template in Word from a quote spreadsheet. The Word document is just a bunch of labels that the captions need to be changed so that they can be printed onto a pre-printed invoice that is normally handwritten.
I can open the word document, I can edit the caption of the standard name, address, date, etc. type labels. The part I am having problems with is the list of items, their quantities, and total prices.
These have all been named as follows: lblQTY, lblQTY1, lblQTY2... up to lblQTY12 (13 in all). I have been scouring the web for a way to fill in these labels without having to write code for each individual label. What I have found is the following:
**********************************************************************
with wddoc
for i = 1 to 12 'we are omitting the first row of items since they do not have a number
.controls("lblQTY" & i).caption = sheet1.range("A", i + 13).value
next i
end with
***********************************************************************
I am using Office 2010, and it comes back with the error: "Run-time error '438': Object doesn't support this property or method.
Any help would be greatly appreciated.
JJ - Vancouver, WA
My question is this:
I am trying to autofill an invoice template in Word from a quote spreadsheet. The Word document is just a bunch of labels that the captions need to be changed so that they can be printed onto a pre-printed invoice that is normally handwritten.
I can open the word document, I can edit the caption of the standard name, address, date, etc. type labels. The part I am having problems with is the list of items, their quantities, and total prices.
These have all been named as follows: lblQTY, lblQTY1, lblQTY2... up to lblQTY12 (13 in all). I have been scouring the web for a way to fill in these labels without having to write code for each individual label. What I have found is the following:
**********************************************************************
with wddoc
for i = 1 to 12 'we are omitting the first row of items since they do not have a number
.controls("lblQTY" & i).caption = sheet1.range("A", i + 13).value
next i
end with
***********************************************************************
I am using Office 2010, and it comes back with the error: "Run-time error '438': Object doesn't support this property or method.
Any help would be greatly appreciated.
JJ - Vancouver, WA