Want FM to print word doc.

Hi friends,
     i want to print "confirmation letter" to MS-word document. is there any FM or sample program?.
Thanks & Regards.
Vallamuthu.M

hi ,
you must use  ABAP OLE , check  this example :
type-pools ole2 .
CREATE OBJECT word 'WORD.APPLICATION' .
  IF sy-subrc NE 0 .
    MESSAGE s000(su) WITH 'Error while creating OLE object!'.
    LEAVE PROGRAM .
  ENDIF .
  GET PROPERTY OF word 'documents' = documents.
  CALL METHOD OF documents 'Add' = newdoc.
  GET PROPERTY OF word 'Selection' = selection.
  call method of selection 'TypeText'
    exporting
    #1 = 'Some data'.
  call method of selection 'HomeKey'
    exporting
      #1 = 5
      #2 = 1.
  get property of selection 'Font' = font.
  set property of font 'Bold' = 1.
check  this link  : 
https://www.sdn.sap.com/irj/scn/go/portal/prtroot/docs/library/uuid/204d1bb8-489d-2910-d0b5-cdddb3227820

Similar Messages

  • Samsung CLP310 printer- printing word doc problem

    i have had a Samsung CLP310 printer for a while and its worked perfectly, however, just recently it has not allowed me to print word.doc files , i have to convert them first to a pdf and then print.
    Does anyone know if there has been a change to the driver or if i have downloaded a recent universal software upgrade that has mucked things up? Any advice well.
    (I have tried the reset printers options etc..)
    Many thanks

    I'm having the same exact problem but can't seem to get ANY response!! The link below was never responded to so I copied it here. IS THERE A WAY TO MAKE ADOBE USE THE "HP" DRIVER AND NOT THE XEROX?????
    http://www.adobeforums.com/webx/.59b4e3da/1
    We have a similar problem with 2007 Excel files embedded in Autodesk Inventor 2008. The pdf preview will look fine, but the PDF file has the black box that you are talking about. Also happens when we print to a Xerox Phaser 7300. When we print to a "HP designjet 800" it will print fine. Does it has something to do with the Xerox printer driver???? We have all the latest updates we beleive? We started with Acrobat Adobe 8.1.1, a new install shouldn't have to install 8.0 first should it?
    Specs: O.S.: XP Pro x64 Edition Version 2003 sp3
    Machine: H.P. xw9300 Workstation, AMD Opteron Processor 250,
    2.39 GHz, 4.00 GB of RAM
    Video: NVIDIA Quadro FX 3450/4000 SDI with driver version 9.1.3.6 running D3D in Inv.
    With NVIDIA Desktop Manager disabled
    3D navigator: 3DConnexion - Spaceball 5000 Driver Ver. 6.3.3

  • I can't print PDF's right with any driver I can print word docs draft qual.

    here's the dealio- my new core2duo doesn't want to communicate with my hp deskjet 832c. I was able to print through my ethernet network to a shared 832c once, and it did print right, but I can't do it again because whatever program I'm in when I try to select a shared printer crashes. That doesn't help with the usb connected printer on my machine though; the only good print I've been able to get is draft quality only in a word doc. My printer spits out tall distorted text, partial and blank pages etc. The new mac mini with the core2duo is doing the same thing with it's hp deskjet 840c.
    iMac   Mac OS X (10.4.9)  

    here's the dealio- my new core2duo doesn't want to
    communicate with my hp deskjet 832c. I was able to
    print through my ethernet network to a shared 832c
    once, and it did print right, but I can't do it again
    because whatever program I'm in when I try to select
    a shared printer crashes. That doesn't help with the
    usb connected printer on my machine though; the only
    good print I've been able to get is draft quality
    only in a word doc. My printer spits out tall
    distorted text, partial and blank pages etc. The new
    mac mini with the core2duo is doing the same thing
    with it's hp deskjet 840c.
    iMac   Mac OS X (10.4.9)  
    Well Mactopians, it seems that my wife has solved this issue by downloading and installing HP's OSXInkjet driver ( even though we're using deskjets) when she visited the HP website. The wonders never cease.

  • Printer suddenty wont print Excel or Quickbooks but will print Word docs

    Help!
    My HP 6500 just decided to stop printing Excel, Quickbooks and Efax but WILL print Word documents and other files. When I hit "okay" ont he print menu the printer head goes back and forth but no ink comes out. Again, the weird thing is that Word docs are fine and print out.
    I have downloaded the driver software twice and turned printer on and off and unplugged it from back of machine.
    Help

    Hi @Salsify,
    Welcome to the HP Forums!
    I see that your HP Deskjet 3050a will print an internet page but not any documents on Windows 7. I am sorry to hear this but happy to help!
    How is the printer connected? Wireless or USB?
    Are you able to make standalone copies with the printer? Copy Text or Mixed Documents.
    In the meantime, I would recommend to try our HP Print and Scan Doctor, and let me know what happens!
    Hope to hear from you soon!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • Failure to print word docs

    I am unable to print from a word doc. I was able to print a test page, can print from outlook and from HP web page. Any suggestions as to what the problem might be? My printer is a HP4400 all in one and I have windows XP home addition installed. Thanks

    Hi there mikekaye,
    Try downloading and running the print and scan doctor located here:
    http://h10025.www1.hp.com/ewfrf/wc/document?docname=c03275041&cc=us&dlc=en&lc=en
    It can fix a lot on its own and if not give a better idea of what is going on.
    Best of Luck!
    You can say thanks by clicking the Kudos Star in my post. If my post resolves your problem, please mark it as Accepted Solution so others can benefit too.

  • Tcode IW32 and Printing Word Docs Attached to Equipment

    Hello,
    This is my fist attempt to use SND so I am hoping for a fast reply that will get me to long on more often.  Here goes.
    I want to be able to print the word documents that are attached to an equipment that is used in the PM order.  When the order is printed a SAP Script form is automatically output.  I want to be able to print the documents attached to the equipment at the same time.  Is that possible.  I have tried the OLE classes but I get a short dump when I try to print the order through the menu Order->Print Order.
    Any help would be appreciated.
    Thanks

    Yes, its possible thru OLE,  first, if not already done, you must in configuration, make it so that the printing happens in the foreground as opposed to the background, then in you print program, you need to retrieve the attached documents.  Here is a routine that is working for us in production now. 
    This is the call of the subroutine,  send thru the business object id, and the BO key, along with a flag
    for print preview on/off.
    perform retrieve_and_print_documents
           using 'BUS1019'
                 your_object_key  " Probably Equipment Number
                 device.
    Here is the routine.  It handles .Doc and .Xls attachments only.
    *     Form  RETRIEVE_AND_PRINT_DOCUMENTS
    form retrieve_and_print_documents using objtyp
                                            objkey
                                            device.
      tables: plko, sood.
      type-pools ole2 .
      data: documents type standard table of neighbor.
      data: document  type neighbor.
      data: docs      like line of documents.
      data: xobject like borident.
      data: objects type standard table of sood4.
      data: object  type sood4.
      data: word type ole2_object.
      data: excel type ole2_object.
      data: workbooks type ole2_object.
      data: app type ole2_object.
      data: filename(200) type c.
    * If background, then do even try it!
      check sy-batch <> 'X'.
    * Retrieve Documents
      xobject-objtype = objtyp.
      xobject-objkey  = objkey.
      clear document. refresh documents.
      call function 'SREL_GET_NEXT_NEIGHBORS'
           EXPORTING
                object       = xobject
                roletype     = 'APPLOBJ'
                relationtype = 'ATTA'
           TABLES
                neighbors    = documents.
    * If no documents, then exit.
      if documents[] is initial.
        exit.
      endif.
      loop at documents into docs.
        select single * from sood
                        where objtp = docs-objkey+17(3)
                          and objyr = docs-objkey+20(2)
                          and objno = docs-objkey+22(12).
        if sy-subrc <> 0.
          continue.
        endif.
    * Create the Microsoft Application Object
        case sood-file_ext.
          when 'DOC'.
            create object word  'WORD.BASIC'.
          when 'XLS'.
            create object excel 'EXCEL.APPLICATION'.
        endcase.
    * Open Document.....
        clear object.
        clear objects. refresh objects.
        object = docs-objkey.  append object to objects.
        call function 'SO_DOCUMENT_DISPATCH_MANAGER'
             EXPORTING
                  activity = 'DISP'
             TABLES
                  objects  = objects.
        if device <> c_preview.
    * Hide Microsoft Application
          case sood-file_ext.
            when 'DOC'.
              call method of word 'APPHIDE'.
            when 'XLS'.
              set property of excel 'VISIBLE' = 0.
          endcase.
          wait up to 2 seconds.
    * Print the Document
          case sood-file_ext.
            when 'DOC'.
              call method of word 'FILEPRINT'.
            when 'XLS'.
              get property of excel 'ACTIVEWORKBOOK' = workbooks.
              call method of workbooks 'PRINTOUT'.
          endcase.
          wait up to 8 seconds.
    * Close Microsoft Application
          case sood-file_ext.
            when 'DOC'.
              call method of word 'APPCLOSE'.
            when 'XLS'.
              call method of excel 'QUIT'.
          endcase.
        else.
    * Minimize Microsoft Application
          case sood-file_ext.
            when 'DOC'.
              call method of word 'APPMINIMIZE'.
            when 'XLS'.
              get property of excel 'APPLICATION' = app.
              set property of app 'WINDOWSTATE' = 2.
          endcase.
        endif.
    * Free the Object
        case sood-file_ext.
          when 'DOC'.
            free object word.
          when 'XLS'.
            free object excel.
        endcase.
      endloop.
    endform.
    Regards,
    Rich Heilman

  • Getting multiple PDFs, when I only want 1, from a Word doc

    When trying to save a Word 2004 document with some pages that are portrait and some landscape as a PDF file (print > save as PDF), the result is multiple PDFs. For example, if the first three pages are portrait, the fourth is landscape, and the fifth portrait again, I'll get 3 PDFs -- pgs 1-3, pg 4, pg 5.
    The Word document has a section break inserted at each point where the page orientation changes. So in the example above, there would be two section breaks, and three sections.
    Using CutePDF on a Windows machine, I don't have this problem, but there is no CutePDF available for Mac.
    Does anyone know a way to address this issue using the Mac's native PDF creation functionality?

    That is the way that it is. The Print>PDF function is integrated into the printing system, and changing orientations while printing is not a good thing to do. Doing so would require the System to make assumptions, and that is not the Mac model for doing things.
    You can combine the files in Preview afterwards, or you can create the document with the same orientation for all the pages and rotate the ones you want in Preview.

  • Printing Word docs sometimes output is messed up

    I'm using Acrobat X Pro for the first time and Windows 7 64-bit with MS Word 2007.
    Basically sometimes I can generate a PDF from Word with no problems at all using the base settings. Then suddenly one will show up all weird, almost like it is monochrome. It happens about 1 in 3 times I generate .docx to .pdf and is driving me crazy.
    I have tried various settings, High Quality, Press etc. as well as changing Color settings and nothing seems to change. Also if a document ends up this way, it will be screwed up no matter how many times I try to generate it. It does not seem to matter what is in the document, but it must be something specific that is causing this. I have tried text files, docs with a lot of graphics and it seems to happen to any type of document...but only sometimes.
    Now if I take a snapshot of the PDF, and put that copied portion back into Word, it looks fine.I tried that to add a small piece of the doc here so people could view it.
    Any ideas?
    Thanks!

    Hi, thanks for the reply - what I am trying to do is PDF the document using the default settings in Acrobat as I usually do.I'm not using any strange fonts or colors and other documents using the exact same parameters are fine when generated.
    I normally use the "Create PDF" option on the Acrobat tab in Word 2007. I have also tried using the Save as - Adobe PDF or the Print - Adobe PDF route and it gives the same result. I am using MS Word 2007 Ultimate - I have no idea if that is 32 or 64 bit, I would assume it is 64.
    This is what the clip above should look like (and does in Word):
    Now I normally do at least 2-3 PDFs a day at work and I have been having this problem for about a month now (since I moved to my current laptop, an old Dell)
    I haven't come across this problem ever before so if you need any more info just let me know.
    Thank you!
    Joel

  • Print Word Doc to Acrobat 9.4.5 fails on 2nd printing

    The oddest behavior is happening, any advice to trouble should would be greatly appreciated.
    When I print a 133 page Word 2010 document with images, text boxes and text, etc.  It prints to the distiller/virtual printer fine ONCE -- but then if I print again to the PDF distiller/virtual printer the text inside the text boxes won't print.
    While troubleshooting and making sure all drivers, MS office, and Acrobat was up to date I discovered that after a restart the document prints fine.  I also noticed while watching the print progress window that the bar moved slower on the first print job and almost twice as fast on the second job which subsequently had missing text inside the text boxes created by word 2010.  I have checked all settings in word and it should print everything and does ONCE.
    What gives, anyone?
    Thanks in advance
    Darrell

    Acrobat is a 32bit app.  Your app needs to be too.

  • 2620 prints word docs with missing text

    I just purchased an offcejet 2620 and it will not print out my word documents correctly. There are missing lines of text and cannot figure out why. I am using a MacBook Air OSX 10.9.4 I need help please! 
    Thanks

    Hi donandsteph,
    Welcome to the HP Forums!
    I see that your HP Officejet 2620 will not print your Word Documents correctly on Mac OS X 10.9.4. I am happy to help!
    I would recommend this print quality guide. Fixing Ink Streaks, Faded Prints, and Other Common Print Quality Problems.
    Hope this guide helps, and let me know if you have any further issues!
    RnRMusicMan
    I work on behalf of HP
    Please click “Accept as Solution ” if you feel my post solved your issue, it will help others find the solution.
    Click the “Kudos Thumbs Up" to say “Thanks” for helping!

  • Can't print Word docs

    Just switched from Windows XP to iMac and had all my hard drive docs, pics, etc. transfered. But I can't print any of the docs, only e-mails and pics. And I can't print pages from recently installed Final Draft. Why?
    Also, why is the text on iMac so tiny, and how do I default enlarge it? Thanks.

    ...or, if anyone is a student in your household, like you or a child of yours, then you qualify for the student price of M$ Office, which is like $160, not too ugly for three apps. Plus, you get (or at least you used to get) three licenses. These licenses are meant for non-pecuniary use only, however.
    If you are a federal or state government employee or employed at an educational institution, the Apple webstore gives personal non-pecuniary use discount prices for people that fall into those categories, too (can't quote you a ballpark price estimate though).
    But, NeoOffice has the best price, although I can't attest to true 100% compatibility with M$ Office in all situations. But even if it's not 100% true across-the-board compatibility, the cost verus risk ratio is hard to ignore.
    It would appear that the trialware version of M$ Office is a crippleware product by design.

  • I got a laser jet 1525nw color printer, when installed it comes up as a 1520,and wont print word doc

    I don't know if it's becuase ot's coming up 1520 or not. But it will print stuff off the internet, but nothing from microsoft office. HELP!!!! I need to send out grauation accounments. thanks

    It appears your printer is a commerical LaserJet printer.
    You may get a better reponse by posting in the commercial LaserJet forums.
    ↙-----------How do I give Kudos?| How do I mark a post as Solved? ----------------↓

  • Can't print downloads can print word docs

    Error message: "an unknown error occurred while trying to print"
    HP C410a series Vista

    HP Printer C410a series.  OS Windows Vista. no changes made to my system.

  • Adobe wont print or download word docs. It's taken over our SYSTEM!!!

    What happened to Adobe? Where have you gone? First of all, where is a decent support link that doesn't take you everywhere to avoid direct support or to ask a question?????
    I am a potential cusotmer for our organization. We have loaded the adobe 9 trial. Now, we cannot download ANY email attachments unless they are adobe. If we want to  download a word doc, the adobe page pops up wanting to convert to adobe before doing anything. That's problem #1
    Problem #2, word docs do not print. The same issue. COmes up wanting to convert to adobe, ok, like download, can live with that FOR NOW to get this done but when we convert to adobe, it will NOT print. Printing function goes away. We've tried saving the docs evereyway possible toprint but the vicious cycle starts all over everytime.
    Oh poor adobe, where have you gone?
    If you want this sale, you better provde the fix ASAP.

    The SPACE here is provided by Adobe, but this is NOT Adobe Support
    I'm not sure that Adobe itself even provides support for demo versions
    To get help here, you need to provide DETAILS about your computer and operating system and version of MS Word
    Someone MAY be able to help if you provide details

  • Does java print service support word docs or text files

    Can anyone tell me that java print service api allows to print word doc files or RTF files etc.

    no it doesn't.
    To print a Word Doc you need to be able to read it, and display it.
    Anything that can be displayed in, say a JPanel, can be printed, cos it's just a matter of displaying the
    image to a virtual component ( a print canvas ). Which then gets printed.
    So, because Java doesn't immediately support Ms Docs, neither does the print service.
    regards,
    Owen

Maybe you are looking for

  • HTTP Headers - enabling caching and compression with the portal?

    Has anyone configured their web server (IIS or Apache) or use a commercial product to flawlessly cache and compress all content generated by the portal? Compression and caching is critical for making our portal based applictions work for overseas use

  • FF crashes on start up after install

    FF crashes on startup, no page displayed. Crashes in Safe mode. Un-install, re-install gives same result. Crash report is too obtuse for me to understand.

  • How can i print a list of a folder contents?

    On previous systems i used to be able to print a complete list of everything in a praticular folder. Very useful for comparing contents or logging contents before backing up and or re-installing. With Tiger i don't seem to be able to do this form the

  • Merging of Two Companies in SAP

    Hai All, My Scenario is Two Companies are going to Merge as one Company. How to Do the Merging in SAP. Is there any methodolgy or Steps to follow.How the Reassisgments are doing in SAP. Regards Gibi Philip

  • Can I wipe my hardrive before upgrading my Macbook to OS X 10.6 by using the Snow Leopard install CD?

    Can I wipe my hardrive before upgrading my Macbook to OS X 10.6 by using the Snow Leopard install CD?  Or do I need I need to wipe my computer from the OS X 10.5 CD that came with the laptop? In other words.  If I purchase the Snow Leopard Software f