Solved

Creating word doc through outlook form

Posted on 2000-03-30
4
219 Views
Last Modified: 2008-02-26
I have a form in which I also want to create a word document.  I would appreciate any help or pointers to where I could get valuable help to accomplish this.
0
Comment
Question by:stino
  • 3
4 Comments
 
LVL 2

Accepted Solution

by:
brice123 earned 150 total points
ID: 2672071
What do you really want to do?
- Attach a Word document in a form?
- Generate a Word document using data from an Outlook form?

In the first case, a custom Post form should be sufficient.
In the second case of (a custom Contact form for example), just place a command button and add a similar code :

Function CommandButtonFax_Click()  
      ' --------------------------------------------
      ' Generate a fax document in Microsoft Word 97
      ' --------------------------------------------
      ' --- Create a new instance of word application
      Set objWordApp = Item.Application.CreateObject("Word.Application")

      objWordApp.Visible = True
   
      ' --- Create a new document based on the specified template
      Set objDoc = objWordApp.Documents.Add("h:\tecdoc\templates\fax.dot", False)

      Set olMAPI = Application.GetNameSpace("MAPI")

      ' --- Replace Bookmarks with data from the current item
      objWordApp.Selection.GoTo -1,,,"To"
      objWordApp.Selection.InsertBefore item.FullName
      objWordApp.Selection.GoTo -1,,,"ToAddress"
      objWordApp.Selection.InsertBefore item.BusinessAddress
      objWordApp.Selection.GoTo -1,,,"ToPhone"
      objWordApp.Selection.InsertBefore item.BusinessTelephoneNumber
      objWordApp.Selection.GoTo -1,,,"ToFaxPhone"
      objWordApp.Selection.InsertBefore item.BusinessFaxNumber
      objWordApp.Selection.GoTo -1,,,"From"

      ' --- Get the current Outlook user
      objWordApp.Selection.InsertBefore olMAPI.CurrentUser
      objWordApp.Selection.GoTo -1,,,"Body"

      Set objWordApp = Nothing
End Function
0
 
LVL 1

Author Comment

by:stino
ID: 2673634
Option 2 hits the nail on the head.  Can I get an example of the template.

email - acastro@bel.com.bz
0
 
LVL 1

Author Comment

by:stino
ID: 2673902
Option 2 hits the nail on the head.  Can I get an example of the template.

email - acastro@bel.com.bz
0
 
LVL 1

Author Comment

by:stino
ID: 2727383
I need to find literature on this stuff.  Also, I want to format the email messages that I develop (bold, indent, etc) so If you have any ideas tell me and I'll post the question.
0

Featured Post

Visualize your virtual and backup environments

Create well-organized and polished visualizations of your virtual and backup environments when planning VMware vSphere, Microsoft Hyper-V or Veeam deployments. It helps you to gain better visibility and valuable business insights.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Outlook Free & Paid Tools
This process describes the steps required to Import and Export data from and to .pst files using Exchange 2010. We can use these steps to export data from a user to a .pst file, import data back to the same or a different user, or even import data t…
Get people started with the process of using Access VBA to control Outlook using automation, Microsoft Access can control other applications. An example is the ability to programmatically talk to Microsoft Outlook. Using automation, an Access applic…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

713 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question