Solved

Ways of accessing existing Word documents

Posted on 2004-10-13
3
225 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 56

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

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!

Question has a verified solution.

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

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 …
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…
Attackers love to prey on accounts that have privileges. Reducing privileged accounts and protecting privileged accounts therefore is paramount. Users, groups, and service accounts need to be protected to help protect the entire Active Directory …

685 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