Results 1 to 2 of 2
  1. #1
    stu_C is offline Advanced Beginner
    Windows XP Access 2007
    Join Date
    Mar 2010
    Posts
    38

    Transfering Form data onto word document template

    Hi all
    I have an access form that once filled out you click a button and transfers everything onto a word template, issue I am having is although the word document is saved as a word template (.dotx) when I use the access form to fill it out it opens the actual template and puts all the data on the actual word template instead of a new document like it would do if you clicked on the word file normally, is there a round this?

    Problem we have if more than one person clicks to create a document they can only do read only

    Code:
    Dim oWd  As Object'Word.Application
    
        Dim oDoc As Object'Word.Document
    
        Dim bm   As Object 'Word.Bookmark
    
        'Set oWd = NewWord.Application
        Set oWd =CreateObject("Word.Application")
        Set oDoc =oWd.Documents.Open("C:\WORDTEMPLATE.dotx")
    
    
    
        Set bm =oDoc.Bookmarks("NAMEID")
    
        bm.Range.Text =UCase(NAMEID)
    
        oWd.Visible = True
    
    
    
        Set bm =oDoc.Bookmarks("ADDRESSID")
    
    
        bm.Range.Text =UCase(ADDRESSID)
    
    
        oWd.Visible = True
    


  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 10 Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    52,902
    First, I have to ask why an Access report will not meet this output requirement. Is there really that much 'boiler plate' and special formatting in the Word document?

    Review https://stackoverflow.com/questions/...ng-access-data

    Instead of Documents.Open use Documents.Add

    How to attach file: http://www.accessforums.net/showthread.php?t=70301 To provide db: copy, remove confidential data, run compact & repair, zip w/Windows Compression.

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

Similar Threads

  1. Replies: 2
    Last Post: 12-19-2017, 06:48 AM
  2. Replies: 3
    Last Post: 06-27-2017, 12:06 PM
  3. Replies: 5
    Last Post: 01-15-2017, 09:53 AM
  4. transferring data from a Word document
    By bdaniel in forum Programming
    Replies: 5
    Last Post: 01-03-2012, 11:16 PM
  5. Replies: 1
    Last Post: 05-20-2011, 07:42 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