• WSbjoeng

    WSbjoeng

    @wsbjoeng

    Viewing 8 replies - 241 through 248 (of 248 total)
    Author
    Replies
    • in reply to: Prevent or protect Header (MS Word 2000) #534408

      Hi again Gary!

      Thanks a lot. I will look into the matter and do necessary amendments.
      Here time is 11:50 and we still have some hours to go. But for you …. … sleep well and be fully rested tomorrow!!

      Best regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #534406

      Thanks a lot Gary. Then I will not try the WindowBeforeDoubleClick Event. As you say; how do one know where the cursor is?

      I also discovered that the code from Bill Coan at http://www.mvps.org/word/FAQs/Customizatio…d2000Header.htm actually has changed. The procedure Document_Close has been omitted. May be I understand why, but not completely. Using it caused the wdApp to be Nothing and then the header was accessible again. Think I take it away and try my templates without for a while before I publish them.

      Now back to work again, have a lot of other things to do!! “Templates” is only a hobby.

      Best regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #534397

      Thanks for the code. It works.
      (Whats BTW?)

      By the way i discovered that the following feature is available in VBA, by looking in help and searching for Document and under New Events:

      WindowBeforeDoubleClick Event

      Occurs when the editing area of a document window is double-clicked, before the default double-click action.

      Syntax:
      Private Sub object_WindowBeforeDoubleClick(ByVal Sel As Selection, ByVal Cancel As Boolean)

      object: An object of type Application declared with events in a class module. For more information about using events with the Application object, see Using Events with the Application Object.

      I tried it but it did not work at once. may be someone has tried this before?

      Best regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #534253

      Hi Gary,

      Thanks again for your comments and suggestion. I have tried it out and it works. regarding my problem it seems that I had missed out the procedure for closing the document. It looks as the wdApp must be set to nothing when the document closes.

      Any way now it works at least on the ones I have tried it out on. It remains to update some other templates in order to get them updated with this functionality.

      Regarding my template: It is more than 100kb and I have therefore ziped it and tried to attach it here but I was not allowed. Can’t understand why because the ziped file is only 53 kb. If you would like to see the template I may need to mail it directly to you. Can I find your mail address here on the lounge?

      Please feel free to comment.

      Best regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #534206

      Sorry the file is too big. I will amend it and then attach it later.

      regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #534205

      Hi Gary,

      Thanks for your sugestions. I will try it and think I might use it.

      To my problem with the template:

      The problem I only have on my PC at work. Siiting at home, like I do now, there seem to be no problem. But if I change some code in the template when I am using it creating a document it very often turns out that it will not work.

      I’m not a programmer in VBA, only trying to adjust what others have done. So e.g. I’m not sure what wdApp contains or whether it ony is a variable without any properties. I will contact some people tpmorrow and try to find out.

      I have attached the template file here. You will also see that it contains other code that has the purpose of beeing able to retreave what was typed in the different text boxes in the dialog box. Try it out and see if it is doing any harm to the protection of the header.

      I hope I will be able to find out what causes the problem at work.

      Best regards

      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #533929

      Edited by gwhitfield on 20-Jul-01 20:51.

      Markup tags added

      Hi Charles,

      The code I pasted into my first message I now have found out that I got it from the following site, an MVP site by Bill Coan:

      http://www.mvps.org/word/FAQs/Customizatio…d2000Header.htm

      If this code is inserted as said in the article it will work. But, I have to show a Dialog Box when the template is started and therefore I put a code(frmNotatEn.Show) to start the Dialog Box in the rutine “Private Sub Document_New()”. By doing so the protection does not function any more.

      I continue looking for an other way of having the Dialog Box open when I generate a new document based on this template.

      (My template is such designed that the dialog box can be retreaved after the new .doc document is saved. The Dialog Box then contains the text I typed in the text boxes the first time. This gives the user a possibility to change any mistakes or simly using the document in a simular situation)

      If someone could test out the code and find a way of getting the dialog box appear, I would appreciate it very much.

      Thanks

      Best regards
      Bj

    • in reply to: Prevent or protect Header (MS Word 2000) #533765

      Hi,
      Thanks for a quick answer.

      The VBA code that I inserted in my mail is placed in a template (e.g. Note-en.dot file) in the module “This Document”.

      The template is used to generate a new file based on the template(standard way of generating a new file in Word). The new Document1 or after saving it as e.g. myfile.doc should then prevent users from accessing the header.
      Sometimes it works , but mostly the header will be opened. No messages. After that the header is allways opened when double-clicking in the header area or opened via view/Header/Footer.

      Best regards
      Bj

    Viewing 8 replies - 241 through 248 (of 248 total)