• WSplarb

    WSplarb

    @wsplarb

    Viewing 15 replies - 1 through 15 (of 36 total)
    Author
    Replies
    • Bob,

      1. have not had this problem in our XP (Windows and Office) for quite a while

      2. never had it in my 2003 Dev environment, but my Word colleague has had the problem

      3. Try this piece of code

      This code needs to reside in a module named “AutoExec” in your Normal.dot

      Sub AutoExec()

      Dim iNumber As Integer
      Dim iCount As Integer
      Dim sIniFile As String

      sIniFile = Options.DefaultFilePath(Path:=wdWorkgroupTemplatesPath) + “Environ.ini”

      iNumber = Val(System.PrivateProfileString(sIniFile, “StartUpTemplates”, “Number”))

      For iCount = 1 To iNumber Step 1
      AddIns.Add FileName:=System.PrivateProfileString(sIniFile, “StartUpTemplates”, CStr(iCount)), Install:=True
      Next iCount
      End Sub

      Now the “Environ.ini” file looks like this:

      [StartUpTemplates]

      Number=6
      1=h:applstemplate1.dot
      2=h:appls template2.dot

      Try this and see how you go.

      REMEMBER: this is NOT perfect, we still get the same problem albeit infrequent (haven’t seen it for 6 months), but lets see if it alleviates the issues you are getting and also makes your startup a bit smarter.

      Pete

    • Bob,

      1. have not had this problem in our XP (Windows and Office) for quite a while

      2. never had it in my 2003 Dev environment, but my Word colleague has had the problem

      3. Try this piece of code

      This code needs to reside in a module named “AutoExec” in your Normal.dot

      Sub AutoExec()

      Dim iNumber As Integer
      Dim iCount As Integer
      Dim sIniFile As String

      sIniFile = Options.DefaultFilePath(Path:=wdWorkgroupTemplatesPath) + “Environ.ini”

      iNumber = Val(System.PrivateProfileString(sIniFile, “StartUpTemplates”, “Number”))

      For iCount = 1 To iNumber Step 1
      AddIns.Add FileName:=System.PrivateProfileString(sIniFile, “StartUpTemplates”, CStr(iCount)), Install:=True
      Next iCount
      End Sub

      Now the “Environ.ini” file looks like this:

      [StartUpTemplates]

      Number=6
      1=h:applstemplate1.dot
      2=h:appls template2.dot

      Try this and see how you go.

      REMEMBER: this is NOT perfect, we still get the same problem albeit infrequent (haven’t seen it for 6 months), but lets see if it alleviates the issues you are getting and also makes your startup a bit smarter.

      Pete

    • Morning,

      if on startup you are loading MULTIPLE templates totalling 1.2 Mb then the problem will occur because the code MIGHT loop to load say Template No 2 BEFORE it has ACTUALLY finished loading Template 1.

      This is what I believe to be the case in our routine.

      And thus you and I will both have to work out how to either determine when a template has finished loading or just place a timer in the code before we then load the next template.

      For example

      for i = 1 to intTemplateCount

      application.templates.add (i)
      ‘thus here the code continues to load the next template BUT due to the “network” Word has not really yet finished loading the previous template
      next i

      Try and place the good ‘ol “DoEvents” – I always place several to yield to the Windows events.

      Hope that helps

      Pete

    • Morning,

      if on startup you are loading MULTIPLE templates totalling 1.2 Mb then the problem will occur because the code MIGHT loop to load say Template No 2 BEFORE it has ACTUALLY finished loading Template 1.

      This is what I believe to be the case in our routine.

      And thus you and I will both have to work out how to either determine when a template has finished loading or just place a timer in the code before we then load the next template.

      For example

      for i = 1 to intTemplateCount

      application.templates.add (i)
      ‘thus here the code continues to load the next template BUT due to the “network” Word has not really yet finished loading the previous template
      next i

      Try and place the good ‘ol “DoEvents” – I always place several to yield to the Windows events.

      Hope that helps

      Pete

    • Afternoon

      1. how big is the normal.dot ? Answer: always make the Normal.dot small

      2. place all the code that was in the Normal.dot into another template

      3. Most important: this error always occurs at our office as we load up about 4171Mb of templates at Word startup accross the network.

      As you can see Template size has a large part to play.

      Answer: whenever this problem occurs just manually add that template via Tools/Template and add-ins etc etc

      Close and re-open Word

      Yes, you say, I don’t have time and it is very frustrating.

      There is No other answer ! is my answer.

      If your templates are huge then make them DLL’s, use the .NET framework.

      Do whatever it takes is the answer.

      No I don’t believe that the template is corrupt when this error occurs I just believe it is due to slow network and the huge size of the files (in our case).

      Always compile the templates !!!! most people don’t do this.

      use “Option Explicit” etc etc

      There are free tools out there that strip extra whitespace from VBA modules as they balloooon with each compilation.

      4. I agree totally that deleting the “~” is very important as word will try and load these temp files and will crash every time.

      Pete

    • Afternoon

      1. how big is the normal.dot ? Answer: always make the Normal.dot small

      2. place all the code that was in the Normal.dot into another template

      3. Most important: this error always occurs at our office as we load up about 4171Mb of templates at Word startup accross the network.

      As you can see Template size has a large part to play.

      Answer: whenever this problem occurs just manually add that template via Tools/Template and add-ins etc etc

      Close and re-open Word

      Yes, you say, I don’t have time and it is very frustrating.

      There is No other answer ! is my answer.

      If your templates are huge then make them DLL’s, use the .NET framework.

      Do whatever it takes is the answer.

      No I don’t believe that the template is corrupt when this error occurs I just believe it is due to slow network and the huge size of the files (in our case).

      Always compile the templates !!!! most people don’t do this.

      use “Option Explicit” etc etc

      There are free tools out there that strip extra whitespace from VBA modules as they balloooon with each compilation.

      4. I agree totally that deleting the “~” is very important as word will try and load these temp files and will crash every time.

      Pete

    • in reply to: Using OnAction in Outlook (Office 2003) #888316

      I really think just lik in Word you need to capture the “event”.

      Have a look at event trapping:

      “with events” is the key search word

      Dim MyClass As New clsWordApp

      Sub AutoOpen()
      Dim wdSaveProtectionType As Integer

      On Error GoTo ErrorHandler

      Call Register_Event_Handler
      End Sub

      Sub Register_Event_Handler()
      Set MyClass.appWord = Word.Application
      End Sub

      Pete

    • in reply to: Using OnAction in Outlook (Office 2003) #888317

      I really think just lik in Word you need to capture the “event”.

      Have a look at event trapping:

      “with events” is the key search word

      Dim MyClass As New clsWordApp

      Sub AutoOpen()
      Dim wdSaveProtectionType As Integer

      On Error GoTo ErrorHandler

      Call Register_Event_Handler
      End Sub

      Sub Register_Event_Handler()
      Set MyClass.appWord = Word.Application
      End Sub

      Pete

    • in reply to: Design Issue (VB6) #887792

      Toolbar, menu bar Buttons: 16 * 16

      Desktop icons 32* 32

      Soem people will also say that 16 * 15 is ok as well

      Pete

    • in reply to: Design Issue (VB6) #887793

      Toolbar, menu bar Buttons: 16 * 16

      Desktop icons 32* 32

      Soem people will also say that 16 * 15 is ok as well

      Pete

    • in reply to: test if Word document is already open in VB (Word 2000) #1808889

      don’t be lazy….try

      Randy Birch in Google – the very first match is him !

      http://vbnet.mvps.org/

      Pete

    • in reply to: test if Word document is already open in VB (Word 2000) #1808871

      Checkout Randy Birch Win32 website. It has far faster code for copying files.

      Pete

    • in reply to: Answer – Gurus – WebBrowser.Navigate (Office XP) #886939

      Method ‘Navigate’ of object ‘IWebBrowser2’ failed

      Afternoon,

      I am using the webbrowser control on a form.

      – yes, I have searched extensively on Google

      1. set the URL for example:

      Me.WebBrowser.Navigate “about:blank”

      2. problem arises when I change the path the next time around. Fo rexample on the “click” event of a button.

      I receive the following error:
      Method ‘Navigate’ of object ‘IWebBrowser2’ failed

      Any ideas?

      Thanks

      Pete

    • in reply to: Answer – Gurus – WebBrowser.Navigate (Office XP) #886940

      Method ‘Navigate’ of object ‘IWebBrowser2’ failed

      Afternoon,

      I am using the webbrowser control on a form.

      – yes, I have searched extensively on Google

      1. set the URL for example:

      Me.WebBrowser.Navigate “about:blank”

      2. problem arises when I change the path the next time around. Fo rexample on the “click” event of a button.

      I receive the following error:
      Method ‘Navigate’ of object ‘IWebBrowser2’ failed

      Any ideas?

      Thanks

      Pete

    • in reply to: Answer – Gurus – WebBrowser.Navigate (Office XP) #887295

      Answer:

      you can NOT use a WebBrowser control on a MultiPage control – and that’s it !

      Workaround: they are bad but this is the only answer.

      1. Minimise the MultiPage control to a height say 17. This makes the user think they are working on a multi page but they are not ! yes, you do not get the good looking layered and edging effect.

      2. Layer your controls over each other and make them visible / invisible depening upon what they click.

      In other words bring to the webbrowser control to the front when needs be and make sure it can hide behind another control in the meantime.

      Then the you will have no erros when navigating to new URL’s.

      Pete

    Viewing 15 replies - 1 through 15 (of 36 total)