A Microsoft Office (Excel, Word) forum. OfficeFrustration

If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Go Back   Home » OfficeFrustration forum » Microsoft Access » New Users
Site Map Home Register Authors List Search Today's Posts Mark Forums Read  

auto filling bookmarks in word2000



 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1  
Old September 4th, 2004, 11:20 PM
Joanne
external usenet poster
 
Posts: n/a
Default auto filling bookmarks in word2000

I am trying to automate the filling in of bookmarks in a word document
with information in my access table.
This is the coding I am using, but something is wrong with it. What
happens is I get a dialog box telling me I can only open in read only
mode as the file is "in use by another user".
SInce it opens only in 'read only' mode, my bookmarks are not filled
in and I am not sure if that portion of the function is working
either.

Could someone help me find the error of my ways please?
I am using MSOffice 2000 on a winxp machine.

Function SetBookmark()
Dim oWrd As Word.Application
Dim oDoc As Object

' Start Microsoft Word and open the document.
Set oWrd = CreateObject("Word.Application")
oWrd.Documents.Open "C:\NMWorkPackage\DirectDepAuthorization.doc"

'Pass the field info to the word bookmark
With oWrd.ActiveDocument.Bookmarks
.Item("SSN").Range.Text = frmEmpContInfo.SSN
End With

'Printout the doc with the bookmarks in place
If Not oDoc Is Nothing Then
oDoc.PrintOut
oDoc.Save = True
oDoc.Close
End If

oWrd.Quit
End Function

Thanks for your time and help. It is surely appreciated
 




Thread Tools
Display Modes

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

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
auto filling text in word and outlook Ronald Guillen General Discussion 1 August 28th, 2004 05:59 AM
Auto fill criteria/questions on filling formulas down JAnderson General Discussion 2 July 19th, 2004 09:45 PM
auto save, auto backup poonam Worksheet Functions 1 July 15th, 2004 03:29 PM
summing based on auto filter Art General Discussion 2 June 13th, 2004 04:19 PM
Auto paragraph number - then remove auto Legalbits General Discussion 2 May 17th, 2004 08:11 PM


All times are GMT +1. The time now is 08:25 PM.


Powered by vBulletin® Version 3.6.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Copyright ©2004-2024 OfficeFrustration.
The comments are property of their posters.