Hi Helmut
I take your point but changing the code to:
Dim MyDb As DAO.Database
Dim wordobj As Word.Application
Dim wordDoc As Object
Dim MyForm As Access.Form
Dim sRTF As String, str As String, stDocName As String
Dim blRet As Boolean
Dim s As Variant, str2 As Variant
Set MyDb = CurrentDb()
Set MyForm = Forms!Property
Set wordobj = CreateObject("word.Application")
Set wordDoc = wordobj.Documents.Add
("C:\Temp\Test.doc")
CF_RTF = RegisterClipboardFormat(RTF)
CF_RTFNOOBJS = RegisterClipboardFormat(RTFRTFNOOBJS)
CF_RETEXTOBJ = RegisterClipboardFormat(RETEXTOBJ)
' description to clipboard
blRet = ClipBoard_SetRTFText(Me.[RTF2Description])
str = "C:\Temp\" & Forms!Property![txtReference]
str2 = Forms!Property![txtReference]
MkDir str
With wordobj
.Visible = 0
.Selection.Text = s
.Selection.Paste
.ActiveDocument.SaveAs FileName:=str2 & ".html",
FileFormat:=wdFormatHTML 'HTML
.ActiveDocument.Close
End With
wordobj.Quit
Set wordDoc = Nothing
Set wordobj = Nothing
This is a route already tried. It saves the new file to
the default Word file folder of D:\Data not to the new
folder created in C:\temp. The first code posted at least
put the saved file into C:\Temp - but not into the new
folder just created. It would appear that within the
saveAs line there should be a reference to a path location
Some guidance please
Tom
-----Original Message-----
Hi Tom,
str = "C:\Temp\" & Forms!Property![txtReference]
MkDir str
"str" is the fullname of a folder (Path & Name) !!!
.ActiveDocument.SaveAs FileName:=str & ".html"
You are trying to concatenate the folder's name
and what is supposed to be the filename's extension.
I don't think, I have to give you an example,
on how to it right. But if you like...
---
Greetings from Bavaria, Germany
Helmut Weber, MVP
"red.sys" & chr(64) & "t-online.de"
Word 2002, Windows 2000
.