Link to home
Start Free TrialLog in
Avatar of dev-ngps7
dev-ngps7

asked on

Accessing a current Word Document

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

Avatar of J_Mak
J_Mak

what's intFileCount?

Why don't you just keep the argument as arrStringPath?
If that doesn't wrok, maybe this link will help:

http://support.microsoft.com/default.aspx?kbid=286892
Try:

 actDoc = WordApp.Documents.Open(arrStringPath(intFileCount).ToString)
ASKER CERTIFIED SOLUTION
Avatar of iboutchkine
iboutchkine

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Try hardcoding the file name:

actDoc = WordApp.Documents.Open("c:\test1.doc")
Avatar of dev-ngps7

ASKER

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:

https://www.experts-exchange.com/questions/21166350/Ways-of-accessing-existing-Word-documents.html

Sorry for the inconvenience caused.