olzba.blogg.se

How to edit protected document ms word
How to edit protected document ms word






how to edit protected document ms word

= ĭim footPath As String = IO.Path.GetFullPath(My.)įootPath = footPath.Substring(0, footPath.Length - 39) & "Resources\LetterheadToken.png" OTok.AlternativeText = "replace_Database.OtherTemplate_" & Split(ComboBox1.Text, " ")(0) & ".Content" RSLT = MsgBox("HEADER TOKEN DETECTED" & vbNewLine & vbNewLine & "Would you like to continue?", vbYesNo, "WARNING") 'If MS WORD DECIDES THIS DOCUMENT "ORIGINATED FROM THE INTERNET", THE CODE CANNOT RUN PAST THIS POINT DUE TO THE "PROTECTED VIEW" AND THE USER CAN'T SEE IT. If FSO.FileExists(Split(fl.Path, ".")(0) & " (LH).dot") Then If Not fl.Path Like "*\Attendance Notes\*" Then If Not fl.Path Like "*\Land Registry\*" Then SSure = MsgBox("Are you Sure?", vbYesNo, "Really?")įor Each GUID In FSO.GetFolder(TextBox1.Text).SubFoldersįor Each PRTY In FSO.GetFolder(GUID.Path).SubFoldersįor Each fl In FSO.GetFolder(PRTY.Path).Files I've marked where the issue occurs with "'****THIS IS WHERE MY PROBLEM IS****" Private Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Clickĭim FSO As New Scripting.FileSystemObject It's sloppy I know but I'm quite new to this and learning every day. Here's my code that cycle through a directory and inserts an image into the header of the document.

how to edit protected document ms word

Manually changing the Trust center settings is unfortunately not an option here, as this code is being run on hundreds of different machines by people who are not comfortable with changing it themselves - their perception is just that my code does not work, As the word object is set to not be visible, this results in the code pausing for use input (Ordinarily choosing to Edit the document) but they can't see it to do so. My issue is that once the document is opened, the code needs to continue and edit the document but my code cannot do so as it opened in 'Protected view'. so when my code was cycling through all the docs in the directory, the code halted at this file since it had now 'Originated form the internet'. In a recent example, one of the files I tried to open with my code was added to the directory externally via an FTP (by me).

how to edit protected document ms word

Now, I know how to change the trust center settings, but I need my application to run on anyones machine and the users (my clientele) are not likely to know how to do it. The code is fine other than if there is one document in there that is considered as 'Originated from the Internet' then the code stops since Word will by default open it in Protected View (visibility is set to false deliberately). I have some code in VB.net that cycles through a directory of documents (.docx) and updates them.








How to edit protected document ms word