Results 1 to 9 of 9
  1. #1
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101

    Open word file off Access form

    Hi everybody,

    I have fairly large Access 2003 tables and forms on my job. I am curious if I can open word document off the form by using command button. Very often I need to put info off the form to word and sent it via e-mail to clients so I every time I have to keep a lot open word documents at the same time on my computer 10 or more that is slow pc down. I would like to have like this : on specific form I have command button and when i need to work with word document , click that button that will open specific word doc and when I am done I think I need a second command button to safe and close word document and so that i can attach it to e-mail and sent it out. So every time I need to work with word doc, I can open it off the form and close it also when I am done with it so no word doc would be open unnecessarily. I am trying to figure this out, but knowledge in vb is really limited so help will be greatly appreciated.
    The best regard to all of you,


    BorisGomel

  2. #2
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    Look at FollowHyperlink and Shell in VBA help.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  3. #3
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thank you very much Paul. I have researched the vb help and come with code below that in click event of command button below:

    Dim str As String ' this is the path to the file
    str = CurDir & "Y:\BorisGomel\CHECKSREQUESTOP2OP3\CheckRequestFor mOp2.doc" 'path to .doc
    Application.FollowHyperlink str

    The problem that it is trying to open the file off this path:
    “c:document and settings\my documentsY:\BorisGomel\CHECKSREQUESTOP2OP3\CheckRe questFormOp2.doc”
    That Is not corrrect. The correct file path is :” "Y:\BorisGomel\CHECKSREQUESTOP2OP3\CheckRequestFor mOp2.doc
    Thank you in advance for advice

    It helps with my job a lot.

    The best Regards,

    BorsiGomel

  4. #4
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    So why are you including the first part? Drop the variable and just include the desired path.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  5. #5
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thnak you .

    I have redone vb code as you told me, however the Access can not open the specifeid fiel due to Run-time Error '490'. I googled this error and it scares me a lot and that as turned out this '409' error impilicate that there are many coorupted files on my pc and the websites that I have visited on google they offer me to download some fix programm to fix this error that I am not comfortable with it. It is my work pc. Please, is there another way to fix this.
    Thank you in advance,
    The best Regards,

    BorsiGomel

  6. #6
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    What is the error description?
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  7. #7
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    When I click command button to open the word doc, the message box pops up :
    The desriptions are below :

    Run-time error '409'

    Can not open the specified file


    Thank you very much.

    Borsigomel

  8. #8
    pbaldy's Avatar
    pbaldy is offline Who is John Galt?
    Windows XP Access 2007
    Join Date
    Feb 2010
    Location
    Nevada, USA
    Posts
    22,525
    Can you open it if you navigate to the path and double click on the file? Perhaps the path isn't correct.
    Paul (wino moderator)
    MS Access MVP 2007-2019
    www.BaldyWeb.com

  9. #9
    BorisGomel is offline Competent Performer
    Windows Vista Access 2003
    Join Date
    Apr 2011
    Posts
    101
    Thanko you pbaldy. Got it .
    Thank you.

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

Similar Threads

  1. Open Word Template from Form Control
    By tanyad in forum Import/Export Data
    Replies: 2
    Last Post: 04-05-2012, 10:13 PM
  2. Open pdf file from Access form
    By lios1984 in forum Access
    Replies: 7
    Last Post: 02-21-2012, 01:11 PM
  3. Open a word document from access
    By natalia in forum Programming
    Replies: 1
    Last Post: 10-13-2010, 08:04 AM
  4. Replies: 1
    Last Post: 09-27-2010, 10:10 AM
  5. 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

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