Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Accessing a current Word Document

Posted on 2004-10-08
7
Medium Priority
?
170 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 28

Accepted Solution

by:
iboutchkine earned 1500 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

Concerto Cloud for Software Providers & ISVs

Can Concerto Cloud Services help you focus on evolving your application offerings, while delivering the best cloud experience to your customers? From DevOps to revenue models and customer support, the answer is yes!

Learn how Concerto can help you.

Question has a verified solution.

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

I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
If you need to start windows update installation remotely or as a scheduled task you will find this very helpful.
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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