[AccessD] conversion troubles

pedro at plex.nl pedro at plex.nl
Wed Mar 16 10:53:12 CST 2005


Hello group,

i have problems when converting a code that was used in A2K to A2003 for merging access to word.
In A2k i used: 

   strTemplateDir = objWord.System.PrivateProfileString("", _
     "HKEY_CURRENT_USER\Software\Microsoft\Office\8.0\Common\FileNew\LocalTemplates", _
     "") & "\"
  strTemplateDir = strTemplateDir & "Pap0\"
    
  strLetter = strTemplateDir & "pap0Herhaling.dot"

I can't find this key after making the Templatefolder "Pap0" and changing the file locations in word.


After that i changed this part of the code into: 

strDocsPath = objWord.Options.DefaultFilePath(wdDocumentsPath) & "\"
   strTemplatePath = objWord.Options.DefaultFilePath(wdUserTemplatesPath)
   strWordTemplate = strTemplatePath & "\" & "pap0Herhaling.dot"

Then i get an error: Error 5: Procedure call or argument is not valid

I am sure that the fieldnames in access the and properties in the dot file are correct. I checked them twice, and they always worked before in A2k and in this part of the code or dot fiel nothing changed.

I placed the pap0Herhaling.dot file in C:\Documents and Settings\PathPedro\Application Data\Microsoft\Sjablonen  (Sjablonen is Dutch for Templates). I also tried the user template folder C:\Documents and Settings\PathPedro\Sjablonen


Who can help me?

Pedro Janssen




More information about the AccessD mailing list