T
Terye N
I've created a document template with a userform. When I pull up a new
document, I want to be able to "fill in the blanks" on the user form, update
the document, and have it sent automatically to a specific email address. I'm
using Word 2003 and Groupwise. So far so good ... it sends the document to
my email, but when I open the document from my email, it is a new - blank -
document, not document with saved information. Here is the code I'm using:
Private Sub Commandok_Click()
Application.ScreenUpdating = False
With ActiveDocument
.Bookmarks("text1").Range.Text = TextBox1.Value
.Bookmarks("text2").Range.Text = TextBox2.Value
.Bookmarks("text3").Range.Text = TextBox3.Value
End With
Application.ScreenUpdating = True
Unload Me
Temp = ActiveDocument.Name
'Open a GroupWare session Object
Set GWApp = CreateObject("NovellGroupWareSession") ' login to GW
'Login using () will login to the open account or run the login
'script if none was opened.
Set gWAccount = GWApp.Login()
'Create a new message in the Mailbox
Set gwMessage = gWAccount.MailBox.Messages.Add
gwMessage.Subject = "Complaint Form"
gwMessage.BodyText = "Please review the enclosed complaint form"
gwMessage.Recipients.Add "(e-mail address removed)"
gwMessage.Attachments.Add Temp 'Add an open workbook to the attachments
gwMessage.Send 'Send out
MsgBox ("Your message been successfully sent!")
ActiveDocument.Close
End Sub
I'm missing something, somewhere ... any help at all would be MUCH appreciated
document, I want to be able to "fill in the blanks" on the user form, update
the document, and have it sent automatically to a specific email address. I'm
using Word 2003 and Groupwise. So far so good ... it sends the document to
my email, but when I open the document from my email, it is a new - blank -
document, not document with saved information. Here is the code I'm using:
Private Sub Commandok_Click()
Application.ScreenUpdating = False
With ActiveDocument
.Bookmarks("text1").Range.Text = TextBox1.Value
.Bookmarks("text2").Range.Text = TextBox2.Value
.Bookmarks("text3").Range.Text = TextBox3.Value
End With
Application.ScreenUpdating = True
Unload Me
Temp = ActiveDocument.Name
'Open a GroupWare session Object
Set GWApp = CreateObject("NovellGroupWareSession") ' login to GW
'Login using () will login to the open account or run the login
'script if none was opened.
Set gWAccount = GWApp.Login()
'Create a new message in the Mailbox
Set gwMessage = gWAccount.MailBox.Messages.Add
gwMessage.Subject = "Complaint Form"
gwMessage.BodyText = "Please review the enclosed complaint form"
gwMessage.Recipients.Add "(e-mail address removed)"
gwMessage.Attachments.Add Temp 'Add an open workbook to the attachments
gwMessage.Send 'Send out
MsgBox ("Your message been successfully sent!")
ActiveDocument.Close
End Sub
I'm missing something, somewhere ... any help at all would be MUCH appreciated