Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7996745
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T14:46:56+00:00 2026-06-04T14:46:56+00:00

I have a program for which I have developed a user guide. I have

  • 0

I have a program for which I have developed a user guide. I have placed this user guide within the project directory. I created a MenuStrip Item by which to open the user guide in Word on the user’s machine. I was successfully able to do this with the following code:

Try
        userGuide = MSWord.Documents.Open("C:Users\administrator\Documents\VisualStudio2010\Project3\UserGuide.doc")

        MSWord.WindowState = Word.WdWindowState.wdWindowStateNormal
        MSWord.Visible = True
    Catch ex As Exception
        MsgBox("An error has prevented the document from opening. The document may not be available." & vbCrLf & vbCrLf & _
               "Please try one of the following options:" & vbCrLf & _
               "- Check to see if the document is already open" & vbCrLf & _
               "- Restart the program")
    End Try

The problem is, the path used to open the file will not exist on the users machine. This is a standalone system, so no file share can be created in which to place the document, therefore no common path can be coded.

Is there a way to code dynamic paths? Perhaps something like:

userGuide = MSWord.Documents.Open("%windir%\UserGuide.doc")

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T14:46:58+00:00Added an answer on June 4, 2026 at 2:46 pm

    if the document will be stored relative to the install path of the application executable, then start with the path of the exe:

    Dim path As String
    path = System.IO.Path.GetDirectoryName( _
          System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase)
    
    Dim docPath as String;
    
    docPath = Path.Combine(path,"UserGuide.doc");
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This is my code I have developed. This is the main program which holds
i have recently developed a list program in android in which there is an
I have enrolled in the iOS developer's program. I've developed an app which I
I have a program which does a system call: latex somefile.latex This runs ok,
I have an Stock program which developed by Delphi, I want a tools which
I have developed a program which makes use of serial programming to read and
I have developed a program in iphone which manage cards, the main functionality is
I have developed a grails/groovy application for a legacy database which has user maintenance
Problem: Have made a small mail program which works perfectly on my developer pc
I have a program which I would like to run every X min the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.