Inserting Picture (from Web- through Webdav) to Word document using VSTO code

Hi,
I have been trying to insert an image/picture to current selection in word. with help of code -
Microsoft.Office.Interop.Word.InlineShape s = this.Application.Selection.InlineShapes.AddPicture(
@"http://127.0.0.1:9001/test/myimage.png", true, true, Type.Missing);
This code works fine if image is on desktop or network shared location but some issues for URL exposed through Webdav.
On inserting the picture word shows - "The linked image cannot be displayed....." message. If we close and open word document again then image appears properly.
Some observations:
1. If we use same option through Ribbon  "Insert -> Picture -> Enter path and click on "Link to File" then we get Prompt for Wevdav password (Only once, later Word caches it) and linked images appear properly.
2. Updating the shape explicitly wouldnt help. 
s.LinkFormat.Update();
What we are looking for is, Does Ribbon "Insert" functionality do something additional to prompt Webdav authentication to cache? if we want to achieve the same? what needs to be invoked before we make call to AddPicture API?
Thanks
H

Thanks for the response.. 
No, when document is opened again, then you dont need to enter the password. 
Somehow on document open event MS word knows how to retreive password from cookie for given domain.
When you insert the image using ribbon -> insert picture option, 
MS Word first looks into cache if the domain cokkie already available then bypass authentication/password prompt
Otherwise it would show the prompt and store the cookie in cache again.
The mystry is how MS-Word interacts with this "cached cookies"
while doing more reading on this, it seems MS Word has been using Klink.dll for this kind of functionality https://support.microsoft.com/en-us/kb/899927 but it would be great if you can provide more pointers.
>>Could you share an image link of Webdav?
Since, it's my local webdav server, you would not be able to access the image link, may be you can upload an image to sharepoint (as sharepoint also supports webdav) and use that for reproducing this problem at your end.
Thanks
H

Similar Messages

  • How can I copy an image/picture from the internet into a word document

    I am trying to copy and paste an image or picture from the internet and insert it into a word document. I select and copy the image from the internet page. I then go to the word document and select past special. When I select 'paste special' it only allows text to be copied and no images or pictures. If I also try to drag the image and place it in the word document. It does not allow me to do so. Any suggestions to fix this issue?

    Considering this is a MS Word issue I'd recommend reposting to that forum. You can find one at:
    http://www.officeformac.com/productforums/
    Regards,
    Roger

  • After upgrading to Yosemite (I don't have iPhoto anymore, only PHOTOS) my pictures will not import from my iPad or iPhone 5s or any picture from web, it shows "Database Error: failured to persist version"

    After upgrading to Yosemite (I don't have iPhoto anymore, only PHOTOS) my pictures will not import from my iPad or iPhone 5s or any picture from web, it shows "Database Error: failured to persist version".  Any help will be greatly appreciated.

    Sorry,
    Yes, the error message is exactly like that  ("Database error: failured to persist version")
    No photos will import at all.  I use USB to import from iPhone 5s or iPad 2. 
    About the difference?  iPhoto and Photos .  Are there two softwares?
    I also will like to merge and/or synchronize all my photos I had saved to iCloud backups, Macbook Pro,  iPhone 5s and iPad hard drives using iPhoto.  It's call iPhoto library.  At one point I turned off streaming. 
    Thanks again Larry HN.

  • How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    Help - How do I insert multiple photos into an excel document vs inserting each individually?  Insert, Picture, From FIle...now what?  it only allows me to choose 1 at a time.

    https://discussions.apple.com/thread/3383532?tstart=0
    Stefan

  • How can I copy pictures from google images into MS word for iMac

    how can I copy pictures from google images into MS word for iMac.
    How can I copy pictures from iphoto to MS word for iMac.

    As MS Word is not an Apple product, you may do better posting in the MS forums:
    Office for Mac forums
    Most people find them very helpful

  • Sorry, we are having some temporary server issues. You can work off line if you plan to insert pictures from your computer

    We have about 200 users that connect to three terminal servers. On the servers we have Office 2013 installed. Several users are stating that when they attempt to search for templates or insert Online Pictures, they are getting error messages of "Sorry,
    we are having some temporary server issues. You can work off line if you plan to insert pictures from your computer"
    Remember, they are connecting to a terminal server, all have roaming profiles, and for some users this works fine.
    We've Googled the error message and found no help. A lot of responses was to reset the IE settings, which we've tried to no avail.
    Also as a test, we took one of the users that was having the issue and deleted their profile. When they logged back on the server, the same problem occurred again.
    We're currently at a loss as to why it works for some users and not others?
    Any ideas out there?

    You can refer to this link and find the possible solution which is to delete the offending registry key:
    HKCU\Software\Microsoft\Office\15.0\Common\Internet\WebServiceCache\AllUsers\office15client.microsoft.com
    http://angrytechnician.wordpress.com/2013/05/15/office-2013-error-sorry-we-are-having-some-temporary-server-issues/
    There we can also find information about deploying logon script to all roaming profile users to resolve this issue.

  • Insert Pictures from SharePoint option missing from Wiki Page

    Hi,
    I have a team site, which was migrated from SP 2010 to 2013.
    In the site pages, I have added a wiki page. In the ribbon - "Insert" - Picture - "From SharePoint" option is missing.
    I have checked various sites, which say publishing feature should be enabled. But in another site (also a team site i can see the "From Sharepoint" option available).
    How to get the "Insert" - Picture - "From SharePoint" option?
    Thanks

    Hi.
    Refer this link
    Here is a thread about it on msdn
    The essence from the thread:
    You'll need to activate SharePoint Server Publishing
    It is not available in enhanced rich text but it is in Publishing HTML. Change your column type to Publishing html and it will work
    http://sharepoint.stackexchange.com/questions/22815/how-to-enable-the-from-sharepoint-link-when-inserting-a-link-in-a-blog-post
    http://jopx.blogspot.in/2012/05/solve-disabled-insert-picture-from.html
    Please remember to click 'Mark as Answer' on the answer if it helps you

  • How can I cut and paste from a webpage to a Word document without the document taking me to the web address when I click on a word in the document?

    How can I cut and paste from a webpage to a Word document without the document taking me to the web address when I click on a word in the document?

    You are trying to copy a link, it is most likely in a different color such as the words "Microsoft's own forums" in his post. In Word highlight the word or words, control click on them, select Hyperlink, then Edit Hyperlink, then delete the link from the top box. It will then have a button asking if you want to "Remove Link", click on it.

  • Insert picture from computer is not working

    Hello
    When I try to insert a picture from the computer, or insert a link from a adress, I am not prompt with anything usable. I can insert pictures from SP and links from SP.
    Se the screen-dump.
    What can I have missed ? Never encountered an error like this.

    Hi,
    Since the characters in screenshot is not English, please confirm if the issue occurs to this when you insert picture from computer:
    If that is the case, please right-click on any white space on this modal dialog and click the properties, copy the Address(URL), you should get something like:
    http://sitename/_layouts/15/Upload.aspx?UseDivDialog=true&LCID=1033&Source=http%3A%2F%2Fsp%3A60%2Fsites%2Fsecond%2FSitePages%2Fp2%2Easpx%3FWikiPageMode%3DEdit%26InitialTabId%3DRibbon%2EEditingTools%2ECPEditTab%26VisibilityContext%3DWSSWikiPage&AssetPageFolder=true&Title=Upload%20Image&DefaultList=Asset&seed=0.030095442653961746&IsDlg=1
    Please check if you can access it directly via IE browser.
    Regards,
    Rebecca Tu
    TechNet Community Support
    Please remember to mark the replies as answers if they help, and unmark the answers if they provide no help. If you have feedback for TechNet Support, contact
    [email protected]

  • How can i remove pictures from my droid turbo without having to use the touch screen on the phone at all?

    how can i remove pictures from my droid turbo without having to use the touch screen on the phone at all?  my screen is cracked and i am waiting on a replacement phone.  as far as i can tell in order to access the phone storage through my computer, i have to use the touchscreen to enable it so that the computer will see it as a camera.  I can't do that as the top half of the touschscreen is unresponsive.  any suggestions?  teaches me to use the backup services offered in the future, but i still need a short term solution for this time.

        I'm sorry to hear your screen is cracked spence425. I know its difficult to use the phone while its damaged. I'm happy you are receiving a replacement device. Have you saved any of your pictures and other data to the cloud? Here is a link about the cloud http://vz.to/1mF0GIx . Unfortunately, you will be unable to remove any data from the phone if the screen is unresponsive but if you are looking to transfer data to your new phone, it would have needed to be saved via the cloud first. Keep us posted.
    Kinquana_VZW
    Follow us on Twitter @vzwsupport

  • I have a MacBook Pro and can't print pdf files or word documents using my HP Wireless Photosmart Printer.  It will print files from the internet.  Any suggestions or ideas will be greatly appreciated.  Thank you.

    I have a MacBook Pro and can't print pdf files or word documents using my HP Wireless Photosmart Printer.  It will print files from the internet.  Any suggestions or ideas will be greatly appreciated.  Thank you.

    Hello, SoonerAnesthetist. 
    Thank you for visiting Apple Support Communities.
    Here is an article that I would recommend going through when experiencing this issue.
    OS X Mavericks: Solve printing problems
    http://support.apple.com/kb/PH14142
    Cheers,
    Jason H.

  • Why does text I copy from a .pdf to a Word document, not copy correctly words containing the combinations 'tt' or 'ti'?

    When I copy text from a .pdf to a Word document, all words containing the combination 'tt' or 'ti' come up as blank boxes,or question marks.  How can I correct this?

    To comment a bit further, several letter combinations like tt and ti as well as many combinations with f are given as a single character in some languages and apparently you do not have that special character on your system.

  • How do I convert from a pdf to a word document?

    How do I convert from a pdf to a word document?

    Hi SGU,
    There are 2 Ways to do this ...
    1. Either Use Adobe Export PDF Service .. Please Refer : https://www.acrobat.com/exportpdf/en_GB/convert-pdf-to-word.html
    2. Use Adobe Acrobat to do it ... Refer : http://www.adobe.com/products/acrobat/pdf-to-word-doc-converter.html

  • HT2506 hi i can't seem to copy and paste pdf files from preview to a microsoft word document. it always comes up with nonsense characters in the word document. how do i fix this? thanks in advance

    hi i can't seem to copy and paste pdf files from preview to a microsoft word document. it always comes up with nonsense characters in the word document. how do i fix this? thanks in advance

    Hi,
    The quickest way to do this (tested with OS 10.8.2, MS Word 2011) is in one line:
    tell application "Microsoft Word" to close every document whose name begins with "book"
    The reason why your script doesn't work is that you aren't specifying to Word which document you want it to close.
    So, changing one line ought to do it:
    close document incrementvalue -- instead of "close document"
    But... when you close a document, you change the document count. Document 2 becomes document 1, document 3 becomes document 2 etc. So eventually you'd get a message saying "The object you are trying to access doesn't exist".
    Because of this, if you want to do it in a repeat loop, you have to work backwards:
    tell application "Microsoft Word"
      set doc_count to count documents
      repeat with x from doc_count to 1 by -1
      if name of document x begins with "book" then close document x
      end repeat
    end tell
    Hope this helps.

  • How do I save a web page as a word document?

    I can't seem to copy a web page into a word document so I can edit it.

    Firefox will no longer allow me to copy a block of text to save it if the block goes farther down than the bottom of the screen. It used to scroll down as far as necessary while holing down the highlight button on the mouse but now stops and will not scroll with a block highlighted beyond the original screen.
    I've been using IE for the past month because firefox stopped allowing this while it still works great in IE.
    I just upgraded to firefox 5.0 hoping it would fix the problem but it did not. Guess I'll be back in the old and slow IE.

Maybe you are looking for