|
我只会在ACCESS中调用WORD模板并设置WORD文件名,如果要在模板中进行进一步操作,需要进一步进行WORD编程,需引用microsoft word 10.0 object library,ACCESS2000是,你可看以下代码:
templatepath = CurrentProject.Path & "\templates\" & 合同类型.Value & ".dot"
myfilename = xjwjmc.Value & ".doc"
appword.Documents.Add Template:=templatepath, NewTemplate:=False, DocumentType:=0
appword.ChangeFileOpenDirectory mypath
appword.ActiveDocument.SaveAs FileName:=myfilename, FileFormat:=wdFormatDocument _
, LockComments:=False, Password:="", AddToRecentFiles:=True, _
WritePassword:="", ReadOnlyRecommended:=False, EmbedTrueTypeFonts:=False, _
SaveNativePictureFormat:=False, SaveFormsData:=False, SaveAsAOCELetter:= _
False
appword.Visible = True
|
|