Solved

Accessing a current Word Document

Posted on 2004-10-08
7
163 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
Comment Utility
what's intFileCount?

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

Expert Comment

by:J_Mak
Comment Utility
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
Comment Utility
Try:

 actDoc = WordApp.Documents.Open(arrStringPath(intFileCount).ToString)
0
Top 6 Sources for Identifying Threat Actor TTPs

Understanding your enemy is essential. These six sources will help you identify the most popular threat actor tactics, techniques, and procedures (TTPs).

 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
Comment Utility
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
Comment Utility
Try hardcoding the file name:

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

Author Comment

by:dev-ngps7
Comment Utility
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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
Microsoft Reports are based on a report definition, which is an XML file that describes data and layout for the report, with a different extension. You can create a client-side report definition language (*.rdlc) file with Visual Studio, and build g…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

771 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now