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. Web Development
  3. ASP.NET
  4. Need Solution to replace text with image in word 2007 and save the file in .pdf format [modified]

Need Solution to replace text with image in word 2007 and save the file in .pdf format [modified]

Scheduled Pinned Locked Moved ASP.NET
tutorialworkspace
1 Posts 1 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.
  • R Offline
    R Offline
    raghvendrapanda
    wrote on last edited by
    #1

    How to replace text with image in word 2007 and save the file in .pdf format this is my code _wordapp.ActiveWindow.Selection.WholeStory(); _wordapp.ActiveWindow.Selection.Copy(); IDataObject data = Clipboard.GetDataObject(); string temp = ""; temp = data.GetData(DataFormats.Text).ToString(); temp = temp.Replace("\r", ""); string[] arrtemp = temp.Split(Environment.NewLine.ToCharArray()); int pos = 0; for (int t = 0; t < arrtemp.Length; t++) { if (arrtemp[t].Contains("Sign1")) { pos = t; string fileName = GetSignPath(); //the picture file to be inserted Object oMissed = _aDoc.Paragraphs[pos].Range; //the position you want to insert Object oLinkToFile = false; //default Object oSaveWithDocument = true;//default _aDoc.InlineShapes.AddPicture(fileName, ref oLinkToFile, ref oSaveWithDocument, ref oMissed); File.Delete(fileName); this.FindAndReplace("Sign1", ""); } } Its replacing at wrong place instead of where i wanted(i.e. in place of Sign1) Sign1 is the text given in the Word 2007 to find and replace it with image Instead it is placing sumwhere else only in the .pdf file Please suggest me the solution code if possible to solve it Its urgent Thanks, Harish

    modified on Wednesday, August 4, 2010 10:21 AM

    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