Results 1 to 4 of 4
  1. #1
    Join Date
    Nov 2014
    Posts
    5

    Word opening in read only when loading from Access

    Hi

    I have a database which produces a word document with bookmarks to infill the data from Access. The code still works and opens the word document but this is only in read only and it does not infill the data e.g. name and address. This only seems to have happened since upgrading to office 2016.

    The code is:

    Private Sub CreateLetter_Click()
    On Error GoTo Err_CreateLetter_Click



    Dim MyWordApp As Object
    Set MyWordApp = CreateObject("Word.Application")
    MyWordApp.Visible = True
    Set worddoc = MyWordApp.Documents.Open("\\location\NTC Letter to tenants unable to contact1.dotx")
    Set WordRef = worddoc.bookmarks("txtRefNo").Range
    Set WordDateRec = worddoc.bookmarks("txtDateRec").Range
    Set WordName = worddoc.bookmarks("txtTenant1").Range
    Set WordAdd = worddoc.bookmarks("txtAddress").Range
    Set WordName3 = worddoc.bookmarks("txtTenant3").Range


    WordRef.InsertAfter Me.TenancyNumber.Value
    WordDateRec.InsertAfter Me.TenancyStartDate.Value
    WordName.InsertAfter Me.Tenant1.Value & " " & Me.Tenant2.Value
    WordAdd.InsertAfter Me.Address.Value
    WordName3.InsertAfter Me.Tenant1.Value & " " & Me.Tenant2.Value


    Exit_CreateLetter_Click:
    Exit Sub
    Err_CreateLetter_Click:
    MsgBox Err.Description
    Resume Exit_CreateLetter_Click

    End Sub

    Does anyone have any ideas?

    thanks
    Andrew

  2. #2
    davegri's Avatar
    davegri is online now Excess Access
    Windows 10 Access 2016
    Join Date
    May 2012
    Location
    Denver
    Posts
    3,413
    Add code to close the letter, and then reopen it.

  3. #3
    redbull's Avatar
    redbull is offline Competent Performer
    Windows XP Access 2010 32bit
    Join Date
    Mar 2012
    Location
    Missouri
    Posts
    480
    Also check running processes, might have it loaded into memory but not visable.

  4. #4
    Join Date
    Nov 2014
    Posts
    5
    Hi thanks for the tips, turned out it was permission issues on the folders which worked in 2007 but something changed in 2016. I changed the document types from .docx to .dotx

Please reply to this thread with any new information or opinions.

Similar Threads

  1. Replies: 2
    Last Post: 04-29-2016, 08:43 AM
  2. Opening as read-only even with full rights?
    By mattetc in forum Access
    Replies: 5
    Last Post: 12-04-2015, 11:05 AM
  3. Replies: 1
    Last Post: 03-22-2014, 04:10 PM
  4. Access 2010 form opening as read only
    By tracer in forum Forms
    Replies: 5
    Last Post: 02-10-2012, 03:52 PM
  5. loading microsoft word with an image
    By dada in forum Programming
    Replies: 0
    Last Post: 08-16-2010, 12:46 AM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Other Forums: Microsoft Office Forums