Upgrading and migrating > Converting encyclopedias to current version > Changes to Microsoft Word templates
  
Changes to Microsoft Word templates
SAGetEncyclopediaPath
If an System Architect Word template uses the SAGetEncyclopediaPath function provided by sawd2001.dll file, to locate encyclopedia files, possibly for inclusion in the document, then these files need to be exported. The reason for this is that in version 9, encyclopedias are maintained within SQL Server databases, not encyclopedia directory paths.
The SAFileExport function will allow the export of an internal file such as a diagram’s .wmf file.
Let intRet = SAGetEncyclopediaPath(strEncyclopediaPath, 255)
Let strFilePath = strEncyclopediaPath & strFilename
..
ActiveDocument.InlineShapes.AddPicture Anchor:=Selection.Range, _ FileName:= strFilePath, LinkToFile:= False, _ SaveWithDocument:=True
For System Architect 9, you must identify a suitable location for a temporary, exported file. When the picture of the diagram has been inserted into the Word document the file will normally be deleted. The SAFileExport function takes the internal file reference and the external path and filename as parameters, returning 1 if the export is successful.
Let strPath = "C:\temp\" ` or other suitable path
Let strFilePath = strPath & strFilename
Call SAFileExport(strFilename, strFilePath)
..
ActiveDocument.InlineShapes.AddPicture Anchor:=Selection.Range, _
FileName:= strFilePath, LinkToFile:=False, _
SaveWithDocument:=True
See also
Converting encyclopedias to current version