MS Office password, username

M

msafro

I am trying to access WebDAV resources using MS Office client. It
generally works however there is one problem. When I open the document
I am prompted to enter user name and password. I open document using
script and I already have credentials inside the script so I wonder if
this is possible to pass the credentials to the Word, Excel, PowerPoint
object somehow so I would not be promted again?

Here is the code:


if (url.indexOf(".doc")>-1
||url.indexOf(".rtf")>-1||url.indexOf(".txt")>-1) //check if pdf
document
{

var objWord = new ActiveXObject ("Word.Application"); //if not open in
word formatter
objWord.visible = true;
objWord.Documents.Open("http://ntotlldev/livelinkedav/"+url);
window.setTimeout('window.close()',5000);
// alert("here")
}
else
{

document.location.href="http://something/WebDav/"+url;
//otherwise open through the browser
if (url.indexOf(".pdf")>-1)
{
window.resizeTo(screen.width,screen.height);
}
else
window.setTimeout('window.close()',5000);

}*/


Thanks


Michael
 
J

Jezebel

Prompted by what application? Word doesn't prompt for a user name. It does
prompt for a document password if the document is secured; you can pass that
as an argument to the open function --

objWord.Documents.Open(FileName:="...", DocumentPassword:="....")
 
M

msafro

Thanks for reply!

The scenario is following:

I generate using ASP remote file path "http://something/word.doc" and
path it into JavaScript.
Javascript creates an object and opens the file using the filename.
The word prompts for user name and password.

If I could control the IIS I possibly could eliminate this prompt but
what is really being called is ISAPI (which is working with WebDAV) and
I thus can not change security on server.

Using the format http://username:password@something/word.doc to open
document did not seem have any effect. So the question is whether I can
pass security credentials into the activex object which I create or
this is not possible by design?
 
J

Jezebel

You'll need to resolve this with whomever scripted the ASP page you're
calling -- there is no general answer. If the ASP page has been scripted to
accept browser arguments, then there is a way to do it; if it's been
scripted always to prompt you, then there isn't.
 

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