Microsoft Office Forums

Go Back   Microsoft Office Forums > >

Reply
 
Thread Tools Display Modes
  #1  
Old 06-30-2016, 03:07 PM
ranayca ranayca is offline How to create a circulating page in MS word Windows 7 64bit How to create a circulating page in MS word Office 2013
Novice
How to create a circulating page in MS word
 
Join Date: Jun 2016
Posts: 1
ranayca is on a distinguished road
Default How to create a circulating page in MS word


I would like to create a word page for survey purpose. After someone completes that survey and hit submit button result would come to me. How to do that? Any suggestions from any pro would be highly appreciated.
Reply With Quote
  #2  
Old 06-30-2016, 09:22 PM
Guessed's Avatar
Guessed Guessed is offline How to create a circulating page in MS word Windows 10 How to create a circulating page in MS word Office 2013
Expert
 
Join Date: Mar 2010
Location: Canberra/Melbourne Australia
Posts: 3,932
Guessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant futureGuessed has a brilliant future
Default

You would need to ensure that the user completing the form trusts you enough to allow macros to run. This is going to be an ongoing problem so I don't think Word is the best solution for you.

I would be using Acrobat or a Web-based form instead.
__________________
Andrew Lockton
Chrysalis Design, Melbourne Australia
Reply With Quote
  #3  
Old 06-30-2016, 09:33 PM
gmayor's Avatar
gmayor gmayor is offline How to create a circulating page in MS word Windows 10 How to create a circulating page in MS word Office 2016
Expert
 
Join Date: Aug 2014
Posts: 4,101
gmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud ofgmayor has much to be proud of
Default

Create a form using legacy form fields or content controls and add an activex button to the form with the following code. Save the form as a macro enabled document and send it to the users. As has been raised, there are issues relating to getting the users to run the macros. A web based form rather than a PDF form which creates further issues relating to data extraction, would be my choice of alternative:

Code:
Option Explicit

Private Sub CommandButton1_Click()
Dim bStarted As Boolean
Dim olApp As Object
Dim oItem As Object
Dim oRng As Range
Dim objdoc As Object
Dim objSel As Selection
Dim bProtected As Boolean
    If IsOutlook Then
        On Error Resume Next
        If Not ActiveDocument.ProtectionType = wdNoProtection Then
            bProtected = True
            ActiveDocument.Unprotect Password:=""
        End If
        Set oRng = ActiveDocument.Range
        oRng.Copy
        'Get Outlook if it's running
        If bProtected = True Then
            ActiveDocument.Protect _
                    Type:=wdAllowOnlyFormFields, _
                    NoReset:=True, _
                    Password:=""
        End If
        Set olApp = GetObject(, "Outlook.Application")
        If Err <> 0 Then
            'Outlook wasn't running, start it from code
            Set olApp = CreateObject("Outlook.Application")
            bStarted = True
        End If
        'Create a new mailitem
        Set oItem = olApp.CreateItem(0)
        With oItem
            .BodyFormat = 2
            .Display
            Set objdoc = .GetInspector.WordEditor
            Set objSel = objdoc.Windows(1).Selection
            objSel.Paste
            .to = "someone@somewhere.com"
            .Subject = "Survey Form"
            .Send
        End With
        If bStarted Then
            'If we started Outlook from code, then close it
            olApp.Quit
        End If
        'Clean up
        Set oItem = Nothing
        Set olApp = Nothing
    Else
        MsgBox "Please return this form to someone@somewhere.com"
    End If
lbl_Exit:
    Exit Sub
End Sub

Private Function IsOutlook() As Boolean
    On Error Resume Next
    IsOutlook = (Not CreateObject("Outlook.Application") Is Nothing)
lbl_Exit:
    Exit Function
End Function
See also http://www.gmayor.com/extract_data_from_email.htm
__________________
Graham Mayor - MS MVP (Word) (2002-2019)
Visit my web site for more programming tips and ready made processes www.gmayor.com
Reply With Quote
Reply

Thread Tools
Display Modes


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to create a circulating page in MS word Would like to mail merge excel spreadsheet with word doc and create new page when a catagory changes esherwood Mail Merge 1 07-21-2014 09:55 PM
How to create a circulating page in MS word Create an index on the first page zelo Word 1 10-17-2013 11:15 PM
Can I create Page Styles janice_2k Word 1 08-24-2012 10:53 AM
How to create a circulating page in MS word Word create a blank page Peterth Mail Merge 4 01-08-2012 09:13 PM
How to create a circulating page in MS word Problems using word to create web page persist Word 1 04-07-2010 04:39 PM

Other Forums: Access Forums

All times are GMT -7. The time now is 07:11 AM.


Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2024, vBulletin Solutions Inc.
Search Engine Optimisation provided by DragonByte SEO (Lite) - vBulletin Mods & Addons Copyright © 2024 DragonByte Technologies Ltd.
MSOfficeForums.com is not affiliated with Microsoft