From: Peter Stone on 8 Dec 2009 12:28 Access 2003/XP Pro I want to create and link MS Word Documents from Access. I have put an unbound frame on an Access form that on double-clicking opens a blank document in Word. The SourceDoc property is C:\Doc\Doc1.doc. I would like to rename the document using text from the controls on my form. E.g. if cboDest.Column(1) is North Beach and txtHeading is Calzone's Restaurant, I would like to Save As: North Beach Calzone's Restaurant. Thank you
From: mjmcevoy on 8 Dec 2009 15:50 Have you tried: Name "CurrentFileName.doc" As cboDest.Column(1) & me.txtHeading.value & ".doc" "Peter Stone" wrote: > Access 2003/XP Pro > I want to create and link MS Word Documents from Access. > I have put an unbound frame on an Access form that on double-clicking opens > a blank document in Word. The SourceDoc property is C:\Doc\Doc1.doc. > > I would like to rename the document using text from the controls on my form. > E.g. if cboDest.Column(1) is North Beach and txtHeading is Calzone's > Restaurant, I would like to Save As: North Beach Calzone's Restaurant. > > Thank you
From: mjmcevoy on 8 Dec 2009 15:53 Will most likely need to add the me. and .value to the combo baox name as well. "mjmcevoy" wrote: > Have you tried: > > Name "CurrentFileName.doc" As cboDest.Column(1) & me.txtHeading.value & ".doc" > > "Peter Stone" wrote: > > > Access 2003/XP Pro > > I want to create and link MS Word Documents from Access. > > I have put an unbound frame on an Access form that on double-clicking opens > > a blank document in Word. The SourceDoc property is C:\Doc\Doc1.doc. > > > > I would like to rename the document using text from the controls on my form. > > E.g. if cboDest.Column(1) is North Beach and txtHeading is Calzone's > > Restaurant, I would like to Save As: North Beach Calzone's Restaurant. > > > > Thank you
From: Peter Stone on 9 Dec 2009 02:34 Thanks for the suggestions. I used the following: Name "Doc1.doc" As Me.Parent!cboDest.Column(1).Value & Me.Parent!txtHeading.Value & ".doc" I get a message "Object required" "mjmcevoy" wrote: > Will most likely need to add the me. and .value to the combo baox name as well. > > "mjmcevoy" wrote: > > > Have you tried: > > > > Name "CurrentFileName.doc" As cboDest.Column(1) & me.txtHeading.value & ".doc" > > > > "Peter Stone" wrote: > > > > > Access 2003/XP Pro > > > I want to create and link MS Word Documents from Access. > > > I have put an unbound frame on an Access form that on double-clicking opens > > > a blank document in Word. The SourceDoc property is C:\Doc\Doc1.doc. > > > > > > I would like to rename the document using text from the controls on my form. > > > E.g. if cboDest.Column(1) is North Beach and txtHeading is Calzone's > > > Restaurant, I would like to Save As: North Beach Calzone's Restaurant. > > > > > > Thank you
From: Peter Stone on 9 Dec 2009 22:16 Here is my current attempt-which results in the message: Object required 'Private Sub cmdOpenWord_Click() On Error GoTo Err_cmdOpenWord_Click Dim LWordDoc As String Dim oApp As Object 'Path to the word document LWordDoc = "c:\Doc\DocBlank.doc" If Dir(LWordDoc) = "" Then MsgBox "Document not found." Else 'Create an instance of MS Word Set oApp = CreateObject(Class:="Word.Application") oApp.Visible = True 'Open the Document oApp.Documents.Open filename:=LWordDoc Name "DocBlank.doc" As Me.cboDest.Column(1).Value & Me.txtHeading.Value & ".doc" End If Exit_cmdOpenWord_Click: Exit Sub Err_cmdOpenWord_Click: MsgBox Err.Description Resume Exit_cmdOpenWord_Click End Sub Peter
|
Next
|
Last
Pages: 1 2 Prev: Linked lists defaults Next: Help with run-time error '2424' and '3265' |