Open a Password Protected Word 2007 Template using VBA -


I am automating the creation of MS Word 2007 documents from MS Access 2007.

The word documents are templates (.dotx) they are password-protected.

When using VBA, I have to go through a password when I open the template. However, using my current method, I can not see any option to do this. If I use documents. Open method, there is a password option, although when I open the template in such a way, it opens the live template and not the copy.

Below is my current code, no help would be appreciated. Pass in a path and open a word document open word templates (string as sDocumentPath, string as sDocumentName) in the form of slow app word word. AppLink is a commentary app called Word.Document Set App Word = New Word as an App Document. App AppWord.Visible = False 'was commented because it opens the live doctor and not a copy of the template. 'App Document = Set App Word. Document. Open the Open (SD Documentpath and AspenNinam ,,, TEMPLMWWD) template. But where can I pass in a password? Set ap document = app word.deqles.ed (SD documentpath and endnatinment) and all

Document .add? Not sure about this, I think you need a document. Open instead

  App Word Document. Open (sDocumentPath and sDocumentName), passwordtemplate: = "Your password", visible: = true  

I know that this is in one of my apps and it works:

  Word.Application.Documents.Open ("C: \ TEMPLATES \ CONTRACT VARIATION. DOT"), passwordTemplate: = "checkopen", visitible: = True  

Comments

Popular posts from this blog

python - Overriding the save method in Django ModelForm -

html - CSS autoheight, but fit content to height of div -

qt - How to prevent QAudioInput from automatically boosting the master volume to 100%? -