View Single Post
 
Old 11-15-2012, 12:22 AM
bigbird69 bigbird69 is offline Windows 7 64bit Office 2010 64bit
Novice
 
Join Date: Nov 2012
Posts: 8
bigbird69 is on a distinguished road
Default

hi macropod thanks for the help,

this document is going to be used for internal use only, the whole office is running office 2010 and windows 7.

i was going to give them the option, after much thought i have decided to keep these forms for future reference.

i have used the code you provided me previously. which is working great instead of the document saving to the temp folder it now saves on the shared drive.

one problem i have is the naming of the document.
it is saving the document under the username but im unsure how to get the document to save using the info that has been written in the ActiveX TextBox

The ActiveX TextBox i want grab the info from is named TextBox111
are you able to help? i have also copied the latest code i am using

regards matt


Code:
Private Sub CommandButton1_Click()
 
Dim OL As Object
Dim EmailItem As Object
Dim Doc As Document
Application.ScreenUpdating = False
Set OL = CreateObject("Outlook.Application")
Set EmailItem = OL.CreateItem(olMailItem)
Set Doc = ActiveDocument
Doc.SaveAs2 FileName:=("S:\DATA\InformationTech\Secured\New Staff") & "\" & Environ("username"), Fileformat:=wdFormatDocument, AddToRecentFiles:=True
With EmailItem
  .Subject = "New Employee"
  .Body = "" & vbCrLf & _
    "" & vbCrLf & _
    ""
  .To = "ITSupport@compnay.com.au"
  .Importance = olImportanceHigh
  .Attachments.Add Doc.FullName
  .Display
End With
Application.ScreenUpdating = True
Set Doc = Nothing
Set OL = Nothing
Set EmailItem = Nothing
 
End Sub
Attached Images
File Type: png textbox111.PNG (3.4 KB, 77 views)

Last edited by macropod; 11-15-2012 at 12:27 AM. Reason: Added code tags & formatting
Reply With Quote