![]() |
|
|
|
#1
|
||||
|
||||
|
Hi bigbird69,
Upon opening your document, I found that you've used ActiveX Controls, Formfields and a Content Control for data entry. You really should stick to just one kind - preferably Formfields or Content Controls. If the document is to be used by people who don't have access to Word 2007 & later, you should only use Formfields. That, of course, rules out using the date picker. Furthermore, if the user has a Mac with Office 2008, they won't have any macro support. I'd also suggest that, rather than forcing the document to be saved to the user's TEMP folder, you give them the option of where to save. The attached template uses formfields, plus a macro that intercepts the document close event to prompt the user to email it. As only a saved document can be emailed, the user is also given the option to save it.
__________________
Cheers, Paul Edstein [Fmr MS MVP - Word] |
|
#2
|
|||
|
|||
|
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
Last edited by macropod; 11-15-2012 at 12:27 AM. Reason: Added code tags & formatting |
|
| Thread Tools | |
| Display Modes | |
|
|
Similar Threads
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
Command Button doesnt work on network
|
rmw85 | Word VBA | 1 | 04-25-2012 01:02 PM |
| outlook 2003 always not remove temp copy of opened attachments in temporary folder | c.itech | Outlook | 0 | 06-20-2011 10:34 PM |
email as pdf attachment - subject line and attachment named after mail merge
|
Nexus | Mail Merge | 12 | 04-13-2011 11:34 PM |
Command Button
|
cksm4 | Word VBA | 7 | 02-27-2011 08:47 PM |
| How can I save multiple email messages to a file folder? (crosspost) | tupham | Outlook | 0 | 08-04-2008 07:56 PM |