Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C#
  4. how to insert undeletable image in word document

how to insert undeletable image in word document

Scheduled Pinned Locked Moved C#
tutorial
4 Posts 4 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    Kumar Arun
    wrote on last edited by
    #1

    :^)How can protect the image to delete. Thanks Arun

    Arun Kr

    C A 2 Replies Last reply
    0
    • K Kumar Arun

      :^)How can protect the image to delete. Thanks Arun

      Arun Kr

      C Offline
      C Offline
      Christian Graus
      wrote on last edited by
      #2

      Please do not cross post.

      Christian Graus - C++ MVP 'Why don't we jump on a fad that hasn't already been widely discredited ?' - Dilbert

      1 Reply Last reply
      0
      • K Kumar Arun

        :^)How can protect the image to delete. Thanks Arun

        Arun Kr

        A Offline
        A Offline
        Alexandru Lungu
        wrote on last edited by
        #3

        As far as I know, you can't! Maybe you can detail what exactly do you want to do...

        R 1 Reply Last reply
        0
        • A Alexandru Lungu

          As far as I know, you can't! Maybe you can detail what exactly do you want to do...

          R Offline
          R Offline
          Rakesh N Bhavsar
          wrote on last edited by
          #4

          Hi! Alexandru how to insert undeletable image in word document? Is it really possible! If so it will help me greate. My requirement is Inserting an e.g. xyz.gif image into the word document. That document we download from the web server. my code behind file in C#.NET 2.0 is: object missing1 = System.Reflection.Missing.Value; string strActualTemplatePath = Server.MapPath("~/TemplateToDownload//"); strActualTemplatePath += Session["TemplateActualName"].ToString(); /* file name which exist on server */ object objFilePath = strActualTemplatePath; /* path of letter where to embed an RefNo_Image. */ object readOnly = false; object isVisible = false; ApplicationClass objWord1 = new ApplicationClass (); Document objWordDoc1 = objWord1.Documents.OpenOld(ref objFilePath, ref missing1, ref readOnly, ref missing1, ref missing1, ref missing1, ref missing1, ref missing1, ref missing1, ref missing1); objWordDoc1.Activate(); objWordDoc1.Tables.Add(objWord1.Selection.Range, 1, 1, ref missing1, ref missing1); string MyImage = Server.MapPath("~/RefNoImages//" + Session["RefNo"].ToString() + ".gif"); if (File.Exists(MyImage)) objWordDoc1.Tables.Item(1).Cell(1, 1).Range.InlineShapes.AddPicture(MyImage, ref missing1, ref missing1, ref missing1); object oSaveChanges = true; objWordDoc1.Close(ref oSaveChanges, ref missing1, ref missing1); objWord1.Application.Quit(ref oSaveChanges, ref missing1, ref missing1); NOTE: The above code is working file on the local machine. But after publishing the website is is not working. Hope you will reply plz reply on rakeshnb@mechsoftgroup.com Thanks & Regards RAKESH BHAVSAR Pune(INDIA)

          1 Reply Last reply
          0
          Reply
          • Reply as topic
          Log in to reply
          • Oldest to Newest
          • Newest to Oldest
          • Most Votes


          • Login

          • Don't have an account? Register

          • Login or register to search.
          • First post
            Last post
          0
          • Categories
          • Recent
          • Tags
          • Popular
          • World
          • Users
          • Groups