Solved

Creating word doc through outlook form

Posted on 2000-03-30
4
183 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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Get an idea of what you should include in an email disclaimer with these Top 5 email disclaimer tips.
Sometimes Outlook might have problems sending a message. There may be various causes- corrupted PST, AV scanner etc. The message, instead of going to the Sent Items folder, sits in the Outbox indefinitely. To remove it you can use a free tool cal…
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…
This Experts Exchange video Micro Tutorial shows how to tell Microsoft Office that a word is NOT spelled correctly. Microsoft Office has a built-in, main dictionary that is shared by Office apps, including Excel, Outlook, PowerPoint, and Word. When …

747 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

Need Help in Real-Time?

Connect with top rated Experts

13 Experts available now in Live!

Get 1:1 Help Now