Solved

Ways of accessing existing Word documents

Posted on 2004-10-13
3
222 Views
Last Modified: 2010-04-23
Is there any other way of getting access to existing  Word documents without creating a new Word document as reference to it?

I am trying to edit the properties in Word from VB.NET

I have the filnenames stored in a String array in one module, and was wondering if i could edit the properties with these filenames without creating a Word document

Example code: Public arrStringPath() As String
                      Dim i As Integer  'index for arrStringPath
                      Dim document As String

                      arrStringPath(i) = document      'document = "D:\Jones\test1\test2\test3\test00111.doc" on first loop

I then have another module that uses this array of filenames, is there anything else i can do to access the Word document properties apart from the following.............

Example code: Dim actDoc As Word.Document
                      Dim wordApp As New Word.Application
                      Dim intFileCount As Integer         'index for public arrStringPath
                         

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

I have recently posted a question("Opening a current Word document with filename in array") about this not working and would appreciate knowing if there is any way around it, thanks in advance.


0
Comment
Question by:dev-ngps7
3 Comments
 
LVL 28

Accepted Solution

by:
iboutchkine earned 500 total points
ID: 12297665
>>Is there any other way of getting access to existing  Word documents without creating a new Word document as reference to it?

When you want to open an existing Word document, you are not creating a new document, you are creating a new object adn there is no way around it. Unless you open word as a text or binary file.
0
 
LVL 27

Expert Comment

by:planocz
ID: 12299100
Word document properties ?

What Word document properties are you wanting to change?
or Do you want to replace a text string or field in the word doc?
0
 
LVL 54

Expert Comment

by:Julian Hansen
ID: 12317533
with reference to thread http://www.experts-exchange.com/Programming/Q_21160867.html#12317443

Just a point - the questions asked in the two threads are different. In this thread you are asking about solving an error you have been receiving and you received answers to those (that you did not respond to).

In the other thread you are asking something completely different i.e. how to access a Word Document without creating a Word Object - and you received answers to that to - basically you can't.

In neither of the threads have you provided any feedback to the questions posted. If you people to assit you you need to assit them by providing the right information and feedback to posts.
0

Featured Post

Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

Question has a verified solution.

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

Suggested Solutions

Article by: jpaulino
XML Literals are a great way to handle XML files and the community doesn’t use it as much as it should.  An XML Literal is like a String (http://msdn.microsoft.com/en-us/library/system.string.aspx) Literal, only instead of starting and ending with w…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.

832 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