Hi,
We have a CRM system, one function of which is to generate custom letters in Word using macros (they drag customer details into templates). Am just setting up PCs with Office 2010 for the first time and found the macros we have for Word 2007 don't work in Word 2010. The dialog box error is "this file could not be found". The portion of the macro brought up in the debugger is below, with the highlighted line it chokes at below.
I've read that Word 2010 is fully compatible with 2007, but wondered if that doesn't apply to Macros? Any clues what may be the cause?
Yes, I have raised it with the CRM supplier, but it may take some time for us to achieve support from them and I really need to resolve this within the next couple of days. Thanks in advance for any suggestions.
---
Private Sub NewForm()
Dim fn$
Dim pn$
Dim Title$
' On Error Goto Trap
Dim FileInfo As Object: Set FileInfo = WordBasic.DialogRecord.FileSummaryInfo(False)
WordBasic.CurValues.FileSummaryInfo FileInfo
' dot$ = FileInfo.Template
fn$ = FileInfo.FileName
pn$ = FileInfo.Directory
Title$ = FileInfo.Title
Dot$ = pn$ + "\" + fn$
WordBasic.DocClose 2
WordBasic.FileNew Template:=Dot$, NewTemplate:=0
If Title$ = "" Then Title$ = "New Merge Document"
WordBasic.FileSummaryInfo Title:=Title$
'Setting title sets DocumentDirty to true
WordBasic.SetDocumentDirty 0
bye:
End Sub
---
It highlights this line in the debug window...
WordBasic.FileNew Template:=Dot$, NewTemplate:=0
We have a CRM system, one function of which is to generate custom letters in Word using macros (they drag customer details into templates). Am just setting up PCs with Office 2010 for the first time and found the macros we have for Word 2007 don't work in Word 2010. The dialog box error is "this file could not be found". The portion of the macro brought up in the debugger is below, with the highlighted line it chokes at below.
I've read that Word 2010 is fully compatible with 2007, but wondered if that doesn't apply to Macros? Any clues what may be the cause?
Yes, I have raised it with the CRM supplier, but it may take some time for us to achieve support from them and I really need to resolve this within the next couple of days. Thanks in advance for any suggestions.
---
Private Sub NewForm()
Dim fn$
Dim pn$
Dim Title$
' On Error Goto Trap
Dim FileInfo As Object: Set FileInfo = WordBasic.DialogRecord.FileSummaryInfo(False)
WordBasic.CurValues.FileSummaryInfo FileInfo
' dot$ = FileInfo.Template
fn$ = FileInfo.FileName
pn$ = FileInfo.Directory
Title$ = FileInfo.Title
Dot$ = pn$ + "\" + fn$
WordBasic.DocClose 2
WordBasic.FileNew Template:=Dot$, NewTemplate:=0
If Title$ = "" Then Title$ = "New Merge Document"
WordBasic.FileSummaryInfo Title:=Title$
'Setting title sets DocumentDirty to true
WordBasic.SetDocumentDirty 0
bye:
End Sub
---
It highlights this line in the debug window...
WordBasic.FileNew Template:=Dot$, NewTemplate:=0