N
Nick Ward
Hi I'm trying to insert some text from an access database into an enclosed
bookmark ( got lots already that insert in placeholders)
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & Choose_template)
'lots of stuff going on here
m_objDoc.SaveAs FileName:=M_strDIRSave &
Forms!frm_quote.CompanyName & _
" - " & FormatDateTime(Date, vbLongDate) & Minute(Now()) &
Second(Now()) & ".doc"
'this next bit was from mvsp.org as it is to get over the deleted enclosed
bookmark problem
Dim bmrange As Range
Set bmrange = m_objDoc.Bookmarks("quoteid").Range ' ref to an enclosed
bookmark
bmrange.Text = Forms!frm_quote.quoteID
ActiveDocument.Bookmarks.Add "quoteid", bmrange
all I get is a typmsmatch error when it tries to set bmrange so I'm
obviously not referencing the document correctly as bmrange=nothing
Thanks in advance
bookmark ( got lots already that insert in placeholders)
Set m_objWord = New Word.Application
Set m_objDoc = m_objWord.Documents.Add(m_strDIR & Choose_template)
'lots of stuff going on here
m_objDoc.SaveAs FileName:=M_strDIRSave &
Forms!frm_quote.CompanyName & _
" - " & FormatDateTime(Date, vbLongDate) & Minute(Now()) &
Second(Now()) & ".doc"
'this next bit was from mvsp.org as it is to get over the deleted enclosed
bookmark problem
Dim bmrange As Range
Set bmrange = m_objDoc.Bookmarks("quoteid").Range ' ref to an enclosed
bookmark
bmrange.Text = Forms!frm_quote.quoteID
ActiveDocument.Bookmarks.Add "quoteid", bmrange
all I get is a typmsmatch error when it tries to set bmrange so I'm
obviously not referencing the document correctly as bmrange=nothing
Thanks in advance