GetObject

L

Let2Editor

I am advised that I can 'open' a document invisibly in order to retrieve a
certain bookmarks content by assigning the document to an object.

Dim odoc As Object
Set oDoc = GetObject("filename")
(text)= odoc.Bookmarks("bkname").Range

It all works, but for some reason it routinely takes about 15 to 20
(interminable) seconds for the odoc object to be created. Am I doing something
wrong?

Ed
 
H

Helmut Weber

Hi,

if you are talking about Word-VBA,
this is the way you would do it:

Dim dTmp As Document
Set dTmp = Documents.Open("c:\test\test-002.doc", Visible:=False)
MsgBox dTmp.Bookmarks("Mark1").Range.Text
dTmp.Close
Set dTmp = Nothing

Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word XP, Win 98
http://word.mvps.org/
 
T

Tom Winter

I can verify that Word 97 does NOT have the .Visible parameter for
Documents.Add and Documents.Open. Word 2000 does.

Tom Winter
(e-mail address removed)
============
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top