473,888 Members | 1,616 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Printing outlook forms in word

1 New Member
I have used the ff command but only get the date printout and have no clue whats wrong:

'Printing function
' - opening a Word template with bookmarks
' - read bookmarks list from template and match with the field names in Outlook form
' - value in form is that populated to the Word doc for auto-printing
' - prompt user for closing Word when printing is done.
' - Save word as C:\deletme.doc before exiting Word.
' 8/21/98 Leng Ho
' 9/16/98 modified to include remove save C:\deletme.doc function
' remove visibility of Word
' correct problem by using Item.UserProper ties.find(strFi eld).value
'

Dim strTemplate
Dim objWord
Dim objDocs
Dim PageRange
Dim strField
Dim strField1


Sub cmdPrint_Click

Set objWord = CreateObject("W ord.Application ")

' Put the name of your Word template that contains the bookmarks
strTemplate = "Facility Request.dot"

' Location of Word template; could be on a shared LAN
'strTemplate = "C:\Documen ts and Settings\Belind am\My Documents\Outlo ok\" & strTemplate
strTemplate = "C:\Documen ts and Settings\Belind am\My Documents\TEST. doc"


Set objDocs = objWord.Documen ts
objDocs.Add strTemplate
set mybklist = objWord.ActiveD ocument.Bookmar ks


'NB!! Not best practice - for testing

'Set the bookmarks
objWord.ActiveD ocument.Bookmar ks("Date").Rang e.text = date
objWord.ActiveD ocument.Bookmar ks("Department" ).Range.text = department
objWord.ActiveD ocument.Bookmar ks("Request").R ange.text = request
objWord.ActiveD ocument.Bookmar ks("Priority"). Range.text = Priority
objWord.ActiveD ocument.Bookmar ks("Requester") .Range.text = requester
objWord.ActiveD ocument.Bookmar ks("TelNo").Ran ge.text = telNo
objWord.ActiveD ocument.Bookmar ks("Deadline"). Range.text = DeadLineDate


objWord.PrintOu t Background = True
objWord.Quit(0)
End Sub
May 8 '07 #1
1 1900
MMcCarthy
14,534 Recognized Expert Moderator MVP
I'm moving this to the Visual Basic forum.

Technical questions are not allowed in the cafe.

ADMIN
May 8 '07 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

9
4124
by: Jody Gelowitz | last post by:
I am trying to find the definition of "Safe Printing" and cannot find out exactly what this entitles. The reason is that I am trying to print contents from a single textbox to no avail using the PrintDialog control under a security setting with only SafePrinting allowed. I have attached a sample project that I am using to try to accomplish this. The print dialog appears, but when I press the Print button, I get an exception (at the end...
2
2320
by: ML | last post by:
This may have been answered lately, but I have not been able to access this group for some time. I am using Access 2000 and Outlook 2000. (Can move to 2002 or 2003 if necessary). Certain reports will always need to be faxed to the same recipient. The latest security patches to Outlook seem to have crippled the use of SendObject etc....
26
4516
by: Tom Becker | last post by:
Is there a way, from Access, to programmatically click the Send and Receive button in Outlook?
12
6389
by: Alex Clark | last post by:
Greetings, (.NET 2.0, WinXP Pro/Server 2003, IE6 with latest service packs). I've decided to take advantage of the layout characteristics of HTML documents to simplify my printing tasks, but of course it's thrown up a whole host of new issues... I'm generating a multi page printable document in HTML from my app, and displaying it in a WebBrowser control. I've looked into using some CSS
8
16961
by: Wayne | last post by:
My supervisor performs the following steps to generate an email notifying recipients of new problem reports: 1) Generate an Access report containing the columnar data and export it to a .rtf file. 2) Using Word, convert the columnar data in the .rtf file to table. 3) Copy the table from Word and paste it in a new Outlook email (default format is RTF). I created a command button in the Access application which opens a new
0
1014
by: sakuragirl1 | last post by:
I have a database where users are entering information into a form and can attach word, mail, powerpoint, etc files. I have code to print word and excel files, but am having difficulty with printing mail(.msg and ..oft). Below is one of the codes i have tried, but am getting an error: "The remote server machine does not exist or is unavailable." on the line that sets the EmDoc. Any help would be appreciated. Private Sub...
0
1175
by: Jordan Richard | last post by:
I'm designing a new .NET 2.0 Windows Forms application to support users who, amongst other things, need to print letters and envelopes. They currently do such printing by manually managing a collection of MS Word documents. They want for the new Windows Forms application to provide the capability to and envelopes. I'm wondering what would be a smart way to provide this capability. I don't want to re-invent MS Word, so perhaps I could...
15
3176
by: =?Utf-8?B?cGF0cmlja2RyZA==?= | last post by:
Hi everyone! Does anyone know how can I do barcode printing? First of all, I know I have to write a client executable, but how do I communicate with the thermal printer? Using software the company I work for needs to buy like Seagull Bartender, or some other label printing software or can I get access to the printer directly?
2
8346
by: deepakfordotnet | last post by:
Hi, First of all let me confess that I could not get the solution to the same problem from an earlier post Printing :by Mr.Richard MSL (dated September 24th 2006) working. (Replied by Mr.Walter Wang - September 27th 2006) My problem is to Print a text from a RichTextBox with all options like - AllowMultiplePages enabled plus PrintPreview and PageSetup. I tried 2 algorithms - 1 posted in Microsoft and 1 posted in this forum. ...
0
9961
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9800
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10777
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10882
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10438
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7990
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5817
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4642
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
4243
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.