View Single Post
 
Old 01-26-2012, 07:14 PM
macropod's Avatar
macropod macropod is offline Windows 7 64bit Office 2010 32bit
Administrator
 
Join Date: Dec 2010
Location: Canberra, Australia
Posts: 21,065
macropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant futuremacropod has a brilliant future
Default

Hi joe,

Your ActiveDocument refernce is ambiguous. Try:
Code:
Dim ws As WorkSheet
Set ws = ThisWorkbook.Sheets("SDF & ER")
Dim objWord As Object
Set objWord = CreateObject("Word.Application")
objWord.Visible = True
objWord.Documents.Open "//Toolbox/bulletinboard/EIP_template.doc"
With objWord.ActiveDocument
  .TextBox1.Value = ws.Range("A13").Value
  .TextBox2.Value = ws.Range("J7").Value
  .TextBox3.Value = ws.Range("A10").Value
  .TextBox4.Value = ws.Range("A16").Value
  .TextBox5.Value = ws.Range("C16").Value
  .TextBox6.Value = ws.Range("A19").Value
  .TextBox7.Value = ws.Range("A25").Value
  .TextBox8.Value = ws.Range("A58").Value
  .TextBox9.Value = ws.Range("B7").Value
  .TextBox10.Value = ws.Range("E7").Value
  .TextBox11.Value = ws.Range("A28").Value
  .TextBox12.Value = ws.Range("B30").Value
  .TextBox13.Value = ws.Range("C64").Value
  .TextBox14.Value = ws.Range("H55").Value
  .TextBox15.Value = ws.Range("A22").Value
  .TextBox16.Value = ws.Range("G7").Value
  .SaveAs FileName:="//Toolbox/bulletinboard/" & ws.Range("J7").Value & ".htm", FileFormat:=wdFormatHTML
End With
__________________
Cheers,
Paul Edstein
[Fmr MS MVP - Word]
Reply With Quote