• WSbjoeng

    WSbjoeng

    @wsbjoeng

    Viewing 15 replies - 31 through 45 (of 248 total)
    Author
    Replies
    • in reply to: Popup for Footnotes (Word2002) #821360

      Yes it does.

      It means I have done something wrong, and I (You) suddenly have solved the problem!

      As I now remember from som VBA help, only one AutoExec procedure will be executed when opening/starting a template.

      I tried it and it now works correct.

      Thanks a lot Hans, sorry to use so mutch time just because I forgot that I had an AutoExec allready.

      Best regards
      and have a nice evening (time is 15:15 and I have to change to summertiers on my electric vehicle, a TH!NK. A previous norwegian battery driven car developed in Norway, bought by Ford. Very good and inexpencive, no toll road charge. Though this has nothing to do with VBA coding.)

      Bj

    • in reply to: Popup for Footnotes (Word2002) #821328

      Yes I did,

      I tried without it and then it did not work.

      I have the following in the ClassModule:

      Public WithEvents app As Application

      Private Sub app_DocumentOpen(ByVal doc As Document)
      CommonCode.PrepareNoMacroTemplate doc ‘ being the procedure in the standard module “CommonCode” to excecuted
      End Sub

      In the module “CommonCode” I have:

      Public OpenMyCls As New OpenCls

      Public Sub AutoExec()
      Set OpenMyCls.app = Application
      MsgBox “Open works” ‘ this Msgbox is not showing
      End Sub

      Public Sub PrepareNoMacroTemplate(doc As Document)
      Debug.Print “The following document is opened: ” & doc.Name ‘ to check if it works
      ThisDocument.UpdateTemplate ‘ being the procedure in ThisDocument to be strated
      End Sub

      In ThisDocument I have:

      Public Sub UpdateTemplate()
      ‘ update code
      End Sub

      Here I also have.

      Private Sub Document_Open()
      Set OpenMyCls.app = Application
      MsgBox “Open works”
      End Sub

      which is started when I “manually” open my global template.

      The initializing of “Public WithEvents app As Application” does not seem to occure, only when the global is opened (again) after Word is started.

      Can it be any setting somewhere?

      Rgds
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821329

      Yes I did,

      I tried without it and then it did not work.

      I have the following in the ClassModule:

      Public WithEvents app As Application

      Private Sub app_DocumentOpen(ByVal doc As Document)
      CommonCode.PrepareNoMacroTemplate doc ‘ being the procedure in the standard module “CommonCode” to excecuted
      End Sub

      In the module “CommonCode” I have:

      Public OpenMyCls As New OpenCls

      Public Sub AutoExec()
      Set OpenMyCls.app = Application
      MsgBox “Open works” ‘ this Msgbox is not showing
      End Sub

      Public Sub PrepareNoMacroTemplate(doc As Document)
      Debug.Print “The following document is opened: ” & doc.Name ‘ to check if it works
      ThisDocument.UpdateTemplate ‘ being the procedure in ThisDocument to be strated
      End Sub

      In ThisDocument I have:

      Public Sub UpdateTemplate()
      ‘ update code
      End Sub

      Here I also have.

      Private Sub Document_Open()
      Set OpenMyCls.app = Application
      MsgBox “Open works”
      End Sub

      which is started when I “manually” open my global template.

      The initializing of “Public WithEvents app As Application” does not seem to occure, only when the global is opened (again) after Word is started.

      Can it be any setting somewhere?

      Rgds
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821316

      Thanks Hans

      If I put the various code into my existing global template which “opens” when I start Word the “Public WithEvents app As Application” will not be initiated. (In the VBA editor this template is not accessible.) But if I, after Word is started, opens my global tempate then it works. (In the VBA editor this template is now accessible.)

      It looks to me that when Word starts and at the same time the global template is started/opened from the startup folder the “Public WithEvents app As Application” is not activated. This seems odd to me; why isn’t it activated?

      If I also place your Global.dot in my Startup it looks as it will work. But then I may have to put the relevant code into that template.

      Do I have to have a separtae global template to accomplish this task?

      Regards
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821315

      Thanks Hans

      If I put the various code into my existing global template which “opens” when I start Word the “Public WithEvents app As Application” will not be initiated. (In the VBA editor this template is not accessible.) But if I, after Word is started, opens my global tempate then it works. (In the VBA editor this template is now accessible.)

      It looks to me that when Word starts and at the same time the global template is started/opened from the startup folder the “Public WithEvents app As Application” is not activated. This seems odd to me; why isn’t it activated?

      If I also place your Global.dot in my Startup it looks as it will work. But then I may have to put the relevant code into that template.

      Do I have to have a separtae global template to accomplish this task?

      Regards
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821268

      OK, but have I understood it right that I should place

      Private Sub Document_Open()
      Set OpenCls.app = Application
      MsgBox “Open works”
      End Sub
      in the Global template’s ThisDocument

      and the other code “Public Sub FixDoc(doc As Document)” in a standard module in the Global template?

      Rgds
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821269

      OK, but have I understood it right that I should place

      Private Sub Document_Open()
      Set OpenCls.app = Application
      MsgBox “Open works”
      End Sub
      in the Global template’s ThisDocument

      and the other code “Public Sub FixDoc(doc As Document)” in a standard module in the Global template?

      Rgds
      Bj

    • in reply to: Intercept Document_Open (Win XP Word 2003) #821263

      (This may be a double post, I answered on Post: 320550)

      Thanks Hans!

      I have tried this but cannot get it working.

      <Public Sub FixDoc(doc As Document)
      < With doc.ActiveWindow
      < .DocumentMap = True ' What exactly does these two methods?
      < .DocumentMap = False
      < End With
      <End Sub

      <3. Put the following code in ThisDocument: ' I presume "ThisDocument" is the module "ThisDocument" in the Global template?
      The document I'm opening does not have areference to a .dot file and thus cannot know anything about the code.

      This procedure in "ThisDocument" will not run:
      Private Sub Document_Open()
      Set myCls.app = Application
      MsgBox "Open works"
      End Sub

      Rgds
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821261

      Thanks Hans!

      I have tried this but cannot get it working.

      <Public Sub FixDoc(doc As Document)
      < With doc.ActiveWindow
      < .DocumentMap = True ' What exactly does these two methods?
      < .DocumentMap = False
      < End With
      <End Sub

      <3. Put the following code in ThisDocument: ' I presume "ThisDocument" is the module "ThisDocument" in the Global template?
      The document I'm opening does not have areference to a .dot file and thus cannot know anything about the code.

      This procedure in "ThisDocument" will not run:
      Private Sub Document_Open()
      Set myCls.app = Application
      MsgBox "Open works"
      End Sub

      Rgds
      Bj

    • in reply to: Popup for Footnotes (Word2002) #821262

      Thanks Hans!

      I have tried this but cannot get it working.

      <Public Sub FixDoc(doc As Document)
      < With doc.ActiveWindow
      < .DocumentMap = True ' What exactly does these two methods?
      < .DocumentMap = False
      < End With
      <End Sub

      <3. Put the following code in ThisDocument: ' I presume "ThisDocument" is the module "ThisDocument" in the Global template?
      The document I'm opening does not have areference to a .dot file and thus cannot know anything about the code.

      This procedure in "ThisDocument" will not run:
      Private Sub Document_Open()
      Set myCls.app = Application
      MsgBox "Open works"
      End Sub

      Rgds
      Bj

    • in reply to: Styles don’t work properly (Word 2003 WinXP) #820584

      Edited by Phil Rabichow to make the link clickable – see Help #19
      Thanks Phil,

      I continued searching and found post 350911 by Stuart and there he says:

      Define everything about each of your 18 styles, except for the numbering first

      Then put the cursor in a Heading 1 style, visit the bullets and numbering box and set the numbering for all 9 heading styles before you exit the box, make sure you use the More button to associate each level with the correct style.

      Then put the cursor in an H1-App style, visit the bullets and numbering box and set the numbering for all 9 appendix styles before you exit

      I presumably hadn’t set the two levels “before you exit” the box.

      Now it looks as it works OK.

      Thanks for a quick anser and good night! (It’s 23:45 and a working day tomorrow)

      Regards
      Bj

    • in reply to: Styles don’t work properly (Word 2003 WinXP) #820585

      Edited by Phil Rabichow to make the link clickable – see Help #19
      Thanks Phil,

      I continued searching and found post 350911 by Stuart and there he says:

      Define everything about each of your 18 styles, except for the numbering first

      Then put the cursor in a Heading 1 style, visit the bullets and numbering box and set the numbering for all 9 heading styles before you exit the box, make sure you use the More button to associate each level with the correct style.

      Then put the cursor in an H1-App style, visit the bullets and numbering box and set the numbering for all 9 appendix styles before you exit

      I presumably hadn’t set the two levels “before you exit” the box.

      Now it looks as it works OK.

      Thanks for a quick anser and good night! (It’s 23:45 and a working day tomorrow)

      Regards
      Bj

    • in reply to: What can cause extream CPU usage (Wind XP, Office 2003) #805251

      Thanks for the help.

      Only have a Global template that is used for some things.

      I will also try to turn off “Allow background saves” in the Tools/Option/Save to see if any effect.

      Thaks!

      Regards
      Bjorn

    • in reply to: What can cause extream CPU usage (Wind XP, Office 2003) #805252

      Thanks for the help.

      Only have a Global template that is used for some things.

      I will also try to turn off “Allow background saves” in the Tools/Option/Save to see if any effect.

      Thaks!

      Regards
      Bjorn

    • in reply to: What can cause extream CPU usage (Wind XP, Office 2003) #805241

      Thanks Hans,

      Soory but it was not the intension to make you read all the code. Thought perhaps that it would show the way the code was made that could indicate a reason for taking so long time.

      I will anyway check all the sugestions that have come in.

      Regards
      Bjormn

    Viewing 15 replies - 31 through 45 (of 248 total)