Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Control Word Document In Web Broswer

Status
Not open for further replies.

PWise

Programmer
Dec 12, 2002
2,633
US
This is what the Boss ordered

Open a word doucment in a access form

No problem -- Put a WebBrowser control on a form and Navigate to the word document Works like o Charm

But this is my problem if I edit the document andd i try to save it i get this message

error 5356
Word cannot save this file because it is already open elsewhere.

how do work around this
 
You can't! The Web browser control is a browser control, not an editor control.

What is the requirement for it to be opened inside an Access form?
If it's just so you can have a rich text editor type control (ie save some text with formatting, then take a look at
hth

Ben

----------------------------------------------
Ben O'Hara
David W. Fenton said:
We could be confused in exactly the same way, but confusion might be like Nulls, and not comparable.
 
found A solution in this Tek Tip post


Problem saving word document


With link to Microsoft KB Article

Error Message: Word Cannot Save This File Because It Is Already Open Elsewhere

What I do find intresting is the code that i use to Navigate to the doc is an UNC
Code:
Me.WebBrowser0.Navigate "\\Server\xxx\somefolder\Somefile.doc"

and to save i use this

Code:
Dim wd As Word.Document
Set wd = Me.WebBrowser0.Document
wd.SaveAs wd.FullName

but when i go

i get
Document in Windows Internet Explorer

the same as when i go

debug.print Me.WebBrowser0.Document.name

Anyone foresee any problems with this?


 
sorry should be
but when i go
Code:
debug.print wd.FullName

i get

Document in Windows Internet Explorer
the same as when i go


Code:
debug.print Me.WebBrowser0.Document.name
Anyone foresee any problems with this?
 
oharab:

Thanks For replying to my question

oharab said:
You can't! The Web browser control is a browser control, not an editor control.

well Obviously you can do this

oharab said:
What is the requirement for it to be opened inside an Access form?

Well: This is what the boss ordered

Alright this document is a collabration between many pepole and the data has to be stored and retrived form our database.
I know i can open this as an independent document and control from access but it is much neater if it opens a a tab on an access form

 
You have access to the whole word object model via the .application object.
Code:
Me.WebBrowser0.Document.Application.
PrintOut is a good example.
The document object also has access to the saveas method.
Code:
Me.WebBrowser0.Document.Application.saveas
Perhaps you could save a copy and delete or archive the original. If you were to open a blank word doc to start with, thus getting us the word object loaded into the browser control, then you could use the .open method to open the actual document you want to edit. Then you are able to save. The problem you are having is trying to save a document that the web control is using.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top