Results 1 to 3 of 3
  1. #1
    ck4794 is offline Advanced Beginner
    Windows 8 Access 2013
    Join Date
    Oct 2013
    Posts
    80

    Open Embedded Word Doc

    so i found this code out there to open a word doc:



    Code:
    Private Sub Command3_Click()
    Dim wrdApp As Word.Application
    Dim wrdDoc As Word.Document
    Dim filepath As String
    
    
    'Open Word
    Set wrdApp = CreateObject("Word.Application")
    wrdApp.Visible = True
    
    
    filepath = Me.forms_FileData
    'Open the file
    Set wrdDoc = wrdApp.Documents.Open(filepath)
    End Sub
    The problem is all the example i found opened a file somewhere on the computer, where as I have the word doc attached.

    I'm using a continuous form, "frmForms" (don't judge me for the name, i know this is asking for confusion but i got it)
    source is a table "optForms"
    attachment field is "File", PK is standard autonumber ID field.

    Can anybody help me with this?

  2. #2
    June7's Avatar
    June7 is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    May 2011
    Location
    The Great Land
    Posts
    53,626
    Bing: access open embedded word document from attachment field

    http://support.microsoft.com/kb/123859/en-us

    Note that the code assumes document is embedded in an OLEObject type field, not Attachment type field. So this might not work with Attachment. The only other way I know to work with documents in Attachment field is to save them out to a folder, open for editing, the save back into the Attachment field. Here is code for managing content of Attachment field: http://blogs.office.com/b/microsoft-...cess-2007.aspx
    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.

  3. #3
    NTC is offline VIP
    Windows 7 64bit Access 2010 32bit
    Join Date
    Nov 2009
    Posts
    2,392
    if by 'embedded' you mean attempting to open Word inside an Access form object - that really is not a good approach. Attempting to embed any full fledged application (Word or otherwise...) inside an Access form object just is not practical. IMO

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

Similar Threads

  1. Print an embedded Word document
    By air3jxt in forum Programming
    Replies: 2
    Last Post: 06-27-2013, 08:30 AM
  2. Open a word document from access
    By natalia in forum Programming
    Replies: 1
    Last Post: 10-13-2010, 08:04 AM
  3. How to open a word/excel/other file in vba
    By pkstormy in forum Code Repository
    Replies: 0
    Last Post: 08-28-2010, 10:36 PM
  4. Open a word dotx from acess
    By frcastro in forum Access
    Replies: 9
    Last Post: 06-17-2010, 12:56 PM
  5. Open Word Doc in foreground
    By patrickmcdiver in forum Programming
    Replies: 1
    Last Post: 03-02-2010, 12:26 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