View Single Post
 
Old 04-11-2013, 03:29 AM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 22,512
macropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond reputemacropod has a reputation beyond repute
Default

You can populate a Word table cell from Excel with code like:
wdDoc.Tables(1).Rows(1).Cells(2).Range.Text = "Hello"
or
wdDoc.Tables(1).Cell(1, 2).Range.Text = "Hello"

And, since you're populating the document directly, you may as well first delete the dropdown there, which you could do with code like:
Code:
With wdDoc.Tables(1).Cell(1, 2).Range
  .ContentControls(1).LockContentControl = False
  .ContentControls(1).Delete
  .Text = "Hello"
End With
After all, having updated the document from Excel, you presumably wouldn't want someone to go and change the values.
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote