Good Morning to all,
I feel goofey asking this question but I have tried for several days now to solve a simple issue. All I want to do is create a new document from template A and this document has a form in it to create a report. When Im ready to create a report I create a new document (from form) and populate bookmarks with my information. Then all I want to do is close down the form and close the original document, thus, leaving the new document in view.
Steps I use:
1) Create a new document based on a template
2) A form loades and I access a database to populate the dialog boxes
3) When I click generate report I create a new word document based on another template and then save it with a name and date.
4) [Problem] I then want to shut down the form and the document that displayed the form but when I try to get the name of the original document it just returns the template name arg
Ex: New doc is "document3" [I cannot get the name document3?] created from template "A". Form pops up and I create a report. Then when I try to close the form and automatically close the document it will now close. When I try "ThisDocument.name" command is displays the name of my template and not the document based on that template.
Macro code Im using =
"
Sub LoadForm()
Load StatusForm
StatusForm.Show 'vbModeless
ThisDocument.SaveAs ("H:\My Documents\SteveTesting\Temp.doc"
Documents("Temp.doc"
.Close wdDoNotSaveChanges
End Sub
"
Does anyone have an idea of what I am missing?
Thank you in advance,
Steve
I feel goofey asking this question but I have tried for several days now to solve a simple issue. All I want to do is create a new document from template A and this document has a form in it to create a report. When Im ready to create a report I create a new document (from form) and populate bookmarks with my information. Then all I want to do is close down the form and close the original document, thus, leaving the new document in view.
Steps I use:
1) Create a new document based on a template
2) A form loades and I access a database to populate the dialog boxes
3) When I click generate report I create a new word document based on another template and then save it with a name and date.
4) [Problem] I then want to shut down the form and the document that displayed the form but when I try to get the name of the original document it just returns the template name arg
Ex: New doc is "document3" [I cannot get the name document3?] created from template "A". Form pops up and I create a report. Then when I try to close the form and automatically close the document it will now close. When I try "ThisDocument.name" command is displays the name of my template and not the document based on that template.
Macro code Im using =
"
Sub LoadForm()
Load StatusForm
StatusForm.Show 'vbModeless
ThisDocument.SaveAs ("H:\My Documents\SteveTesting\Temp.doc"
Documents("Temp.doc"
End Sub
"
Does anyone have an idea of what I am missing?
Thank you in advance,
Steve