G
Glenn Suggs
I'm trying to create a new Word document using VBA from Access and am having
problems when I go to save the document. An error message says that there is
no document currently open (to save).
Here is the way the code begins (after setting a reference to Word):
Set wrdApp = New Word.Application
Documents.Add DocumentType:=wdNewBlankDocument
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Typing here for the body of the document."
{more typing}
{more typing}
{more typing}
wrdApp.ActiveDocument.SaveAs FileName:=strTempFile, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
During this "Save" process, that's when the error occurs.
Any suggestions?
Thanks in advance.
problems when I go to save the document. An error message says that there is
no document currently open (to save).
Here is the way the code begins (after setting a reference to Word):
Set wrdApp = New Word.Application
Documents.Add DocumentType:=wdNewBlankDocument
Selection.TypeParagraph
Selection.TypeParagraph
Selection.TypeText Text:="Typing here for the body of the document."
{more typing}
{more typing}
{more typing}
wrdApp.ActiveDocument.SaveAs FileName:=strTempFile, FileFormat:= _
wdFormatDocument, LockComments:=False, Password:="",
AddToRecentFiles:= _
True, WritePassword:="", ReadOnlyRecommended:=False,
EmbedTrueTypeFonts:= _
False, SaveNativePictureFormat:=False, SaveFormsData:=False, _
SaveAsAOCELetter:=False
During this "Save" process, that's when the error occurs.
Any suggestions?
Thanks in advance.