R
Robert_L_Ross
This post is step 2 of another post...
I am trying to have a Word Fax Cover Sheet populate it's data from an Excel
Spreadsheet that contains contact information (To, Attn, Fax#, Phone#)
I'd like to have the document open, populate a DropDown box with the Attn
info from an Excel Spreadsheet, then when one of those selections are made,
populate the To, Fax# and Phone# from the same Excel spreadsheet.
Through other posts, I've got this much:
Dim CSFaxApp As Excel.Application
Dim CSFaxWorkbook As Excel.Workbook
Dim CSFaxSheet As Excel.Worksheet
Dim CSFaxArray As Excel.Range
Dim ATTNBoxInfo As Variant
Dim ToBoxInfo As Variant
Dim FAXBoxInfo As Variant
Dim PHONEBoxInfo As Variant
Dim ArrFaxInfo As String
Set CSFaxApp = GetObject(, "Excel.Application")
Set CSFaxWorkbook = GetObject("pathname\CSFaxList.xls")
Set CSFaxSheet = CSFaxWorkbook.Worksheets(1)
Set CSFaxArray = CSFaxSheet.Range("a2:e4")
ATTNBoxInfo = ActiveDocument.FormFields("ATTNBox").DropDown.Value
MsgBox (ATTNBoxInfo)
....then at the end:
ActiveDocument.FormFields("ToBox").Result = ToBoxInfo
ActiveDocument.FormFields("FaxNumber").Result = FaxNumberInfo
ActiveDocument.FormFields("TelNumber").Result = TelNumberInfo
At this point, the Sheet has 4 columns:
Entry (the dropdown entry case (1-3, etc.)
Attn - What I want to populate into the DropDown box when the doc opens
To, Fax and Phone - What I want returned and placed into the corresponding
fields on the doc
Can anyone give me any info to populate the dropdown list from Excel? I'm
guessing it should be something along the line of:
ActiveDocument.FormFields("AttnBox").DropDown.ListEntries.Add (something here)
And can anyone give me any info on how to then search the Excel sheet and
return the values it finds based on the dropdown entry?
THX in advance for taking the time to read over this and THX x 2 if you reply!
I am trying to have a Word Fax Cover Sheet populate it's data from an Excel
Spreadsheet that contains contact information (To, Attn, Fax#, Phone#)
I'd like to have the document open, populate a DropDown box with the Attn
info from an Excel Spreadsheet, then when one of those selections are made,
populate the To, Fax# and Phone# from the same Excel spreadsheet.
Through other posts, I've got this much:
Dim CSFaxApp As Excel.Application
Dim CSFaxWorkbook As Excel.Workbook
Dim CSFaxSheet As Excel.Worksheet
Dim CSFaxArray As Excel.Range
Dim ATTNBoxInfo As Variant
Dim ToBoxInfo As Variant
Dim FAXBoxInfo As Variant
Dim PHONEBoxInfo As Variant
Dim ArrFaxInfo As String
Set CSFaxApp = GetObject(, "Excel.Application")
Set CSFaxWorkbook = GetObject("pathname\CSFaxList.xls")
Set CSFaxSheet = CSFaxWorkbook.Worksheets(1)
Set CSFaxArray = CSFaxSheet.Range("a2:e4")
ATTNBoxInfo = ActiveDocument.FormFields("ATTNBox").DropDown.Value
MsgBox (ATTNBoxInfo)
....then at the end:
ActiveDocument.FormFields("ToBox").Result = ToBoxInfo
ActiveDocument.FormFields("FaxNumber").Result = FaxNumberInfo
ActiveDocument.FormFields("TelNumber").Result = TelNumberInfo
At this point, the Sheet has 4 columns:
Entry (the dropdown entry case (1-3, etc.)
Attn - What I want to populate into the DropDown box when the doc opens
To, Fax and Phone - What I want returned and placed into the corresponding
fields on the doc
Can anyone give me any info to populate the dropdown list from Excel? I'm
guessing it should be something along the line of:
ActiveDocument.FormFields("AttnBox").DropDown.ListEntries.Add (something here)
And can anyone give me any info on how to then search the Excel sheet and
return the values it finds based on the dropdown entry?
THX in advance for taking the time to read over this and THX x 2 if you reply!