PC Review


Reply
Thread Tools Rate Thread

Bookmark questions Access/Word Error Message Two Questions

 
 
Kenny G
Guest
Posts: n/a
 
      1st Aug 2008
1. Below is my code to print a Word document. The data for the Word
document comes from a table under the subform sfrmReports. Sfrm reports is a
subform of frmReports. Should the frm or sfrm be referenced in my code?
Currently I have the frm.

2. I am getting the following error message "Word cannot save this file
because it is already open elsewhere."

Sub PrintTracerSurveyReport(tblNonCompIPOPAllStandards)
Dim objWord As Word.Application
Dim objDoc As Word.Document

'Launch Word and load the JCAHOTracerPreSurveyReport template
Set objWord = New Word.Application
objWord.Visible = False
Set objDoc = objWord.Documents.Add("S:\Quality & Process
Improvement\QPI\JCAHO PreSurvey Tool\Documents\JCAHOPreSurveyReport.dot")
'Add information using predefined bookmarks

With objDoc.Bookmarks
.Item("DirectorCoordinator").Range.Text =
frmReports.DirectorCoordinator
.Item("SurveyID").Range.Text = frmReports.SurveyID
.Item("SurveyDate").Range.Text = frmReports.SurveyDate
.Item("SubSiteName").Range.Text = frmReports.SubSiteName
.Item("Standard").Range.Text = frmReports.Standard
.Item("Observation").Range.Text = frmReports.Observation
.Item("Recommendation").Range.Text = frmReports.Recommendation
.Item("FollowupComments").Range.Text = frmReports.FollowupComments
End With

objWord.PrintOut
objDoc.Close wdDoNotSaveChanges
objWord.Quit

End Sub

Any help would be appreciated.
--
Kenny G
 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Form that asks questions based on responses to other Questions =?Utf-8?B?YWtrcnVn?= Microsoft Access Getting Started 3 6th Jul 2007 02:43 PM
Re: After the Deletion of Google Answers, U Got Questions Fills the Gap Answering and Asking the Tough Questions sechumlib Microsoft C# .NET 0 7th May 2007 07:35 PM
Two questions about an error message Mark Windows XP Help 3 12th Dec 2004 12:43 AM
TWO QUESTIONS - Address book and error message =?Utf-8?B?Z2xvcmlh?= Windows XP General 0 20th Oct 2004 10:53 AM
xp - driver installation error message questions Windows XP Hardware 0 24th Oct 2003 05:12 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 02:25 AM.