473,327 Members | 2,081 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,327 software developers and data experts.

print word file to pdf from outlook macro

hi all,

i currently have a macro in outlook to alter a word document, save as new file and attach. is there any way to, in this automated process, print the word output to pdf and attach the pdf instead?

-tomas
Dec 13 '07 #1
1 1210
Dököll
2,364 Expert 2GB
hi all,

i currently have a macro in outlook to alter a word document, save as new file and attach. is there any way to, in this automated process, print the word output to pdf and attach the pdf instead?

-tomas
Hello Hello, BlackMustard!

Here is a bit of code you can use to read a pdf file?

Perhaps you can tweak it to fit your neeeds:

Expand|Select|Wrap|Line Numbers
  1.  
  2. Option Explicit 
  3.  
  4. Public Declare  Function ShellExecute Lib "shell32.dll" Alias "ShellExecuteA" _ 
  5. (ByVal hwnd As Long, _ 
  6. ByVal lpOperation As String, _ 
  7. ByVal lpFile As String, _ 
  8. ByVal lpParameters As String, _ 
  9. ByVal lpDirectory As String, _ 
  10. ByVal nShowCmd As Long) As Long 
  11.  
  12. Sub Open_PDF() 
  13.     ShellExecute 0, "open", "C:\YOURFOLDER.YOURFILE.pdf", "", "", 1 
  14. End Sub 
  15.  
  16.  
  17.  
Will fetch a bit here, perhaps something has been posted...

In a bit!
Dec 16 '07 #2

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

Similar topics

8
by: Jaime Rios | last post by:
Hi, I created a COM AddIn for Word that performs the functions that it needs to, but I needed to add the ability for the toolbar created by the COM AddIn to remember it's last position and...
4
by: MLH | last post by:
I have tblFiles with and fields. DLookUp("","tblFiles","=22") returns "c:\EMLfiles\00002.eml". The return string is a pointer to a dot-eml file in c:\EMLfiles. The dot-eml file was created in...
3
by: Martin Austin | last post by:
Here's my problem. I'm launching an MS Word object on a Notes document Postopen event. The script kicks off a macro that saves the Word document to a temporary file every n minutes (backup of key...
7
by: R Reyes | last post by:
Can someone please explain to me why I can't get the MS Word Interop assembly to work in my VS2005 project? I'm trying to manipulate MS Word from my Web Form application and I can't get passed...
4
by: cherub | last post by:
I am not a programmer but i am trying to run the following script i thought i figured out with a book, but i am getting an error. Here is what i need it to do: From Outlook 03 Custom Contact Form...
0
by: vandervelde | last post by:
Hi, A couple of machines in the office have recently upgraded to word 2003 and the printing macros for these machines are working intermittently. The macro takes the computer name and a printer...
2
by: alivip | last post by:
when I wont to inser (anyting I print) to the textbox it will not inser it just print then hanging # a look at the Tkinter Text widget # use ctrl+c to copy, ctrl+x to cut selected text, #...
12
by: Studiotyphoon | last post by:
Hi, I have report which I need to print 3 times, but would like to have the following headings Customer Copy - Print 1 Accounts Copy - Print 2 File Copy -Print 3 I created a macro to...
1
by: grego9 | last post by:
I am trying to write a macro that will print all files in a particular folder. The folder will always have the same name - but the number of files in that folder may differ. I simply want a macro...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Shćllîpôpď 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.