Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

I wrote a method which will convert the word documents in a sharepoint library into PDF.

public WordToPDF(string fileName, string filePath, string userName, string passWord)

{
    //Code to convert word to PDF.

}

I can give the username and password hardcoded.But in runtime I am unable to use this method.Because you are unable to retrive the password in sharepoint.So How can I modify the above function? Thank YOU.

share|improve this question
    
Can you provide some more details? Where is this method coming from, what are you using for the underlying PDF Conversion? Is this a third party SharePoint PDF Converter or something you wrote yourself? –  Muhimbi Mar 7 '11 at 10:02
add comment

1 Answer 1

Where are you getting an access error at? If the code is running through SharePoint, it will use the credentials of the currently logged in user. If the code is running outside of SharePoint, then you'll need to setup credentials object.

With the information you provided, I would guess that you should just remove the username and password part of the method and let it run with the current user's security level. I wouldn't recommend manually overriding the credentials for this because it opens up possible modifications by users who aren't allowed to modify files.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.