Solved

Accessing a current Word Document

Posted on 2004-10-08
7
165 Views
Last Modified: 2010-04-23
Here is a tough and confusing problem i have, please consider the following code

actDoc = WordApp.Documents.Open(arrStringPath(intFileCount))

actDoc is of type Word.Document
WordApp is of type Word.Application
arrStringPath has the pathname of the word document

When debugging, this message appears as the line of code above is processed

* no user rights (i have sufficient rights)
*document name of path invalid (all path names are stored in the array)

I have used a watch to confirm pathnames are being input into the array

0
Comment
Question by:dev-ngps7
7 Comments
 
LVL 7

Expert Comment

by:J_Mak
ID: 12258476
what's intFileCount?

Why don't you just keep the argument as arrStringPath?
0
 
LVL 7

Expert Comment

by:J_Mak
ID: 12258531
If that doesn't wrok, maybe this link will help:

http://support.microsoft.com/default.aspx?kbid=286892
0
 
LVL 4

Expert Comment

by:gdexter
ID: 12258856
Try:

 actDoc = WordApp.Documents.Open(arrStringPath(intFileCount).ToString)
0
Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 12259784
did you try this

'late binding. No references


        Dim objWord As Object
        Dim objDoc As Object

        objWord = CreateObject("Word.Application")
        objDoc = CreateObject("Word.Document")
        objWord.Visible = True

        Try
            objDoc = objWord.Documents.Open("c:\temp\doc1.doc")
        Catch
            MessageBox.Show("Document couldn't be opened")
        End Try
0
 
LVL 8

Expert Comment

by:wguerram
ID: 12267985
Try hardcoding the file name:

actDoc = WordApp.Documents.Open("c:\test1.doc")
0
 

Author Comment

by:dev-ngps7
ID: 12317442
I wish to close this thread due to the fact that i accidently opened up more threads with the same sort of question. For this, i can only  apologise as i am new to Experts Exchange. This problem can be further discussed here:

http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/VB_DOT_NET/Q_21166350.html

Sorry for the inconvenience caused.
0

Featured Post

Courses: Start Training Online With Pros, Today

Brush up on the basics or master the advanced techniques required to earn essential industry certifications, with Courses. Enroll in a course and start learning today. Training topics range from Android App Dev to the Xen Virtualization Platform.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Parsing a CSV file is a task that we are confronted with regularly, and although there are a vast number of means to do this, as a newbie, the field can be confusing and the tools can seem complex. A simple solution to parsing a customized CSV fi…
The ECB site provides FX rates for major currencies since its inception in 1999 in the form of an XML feed. The files have the following format (reducted for brevity) (CODE) There are three files available HERE (http://www.ecb.europa.eu/stats/exch…
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.
With Secure Portal Encryption, the recipient is sent a link to their email address directing them to the email laundry delivery page. From there, the recipient will be required to enter a user name and password to enter the page. Once the recipient …

786 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question