Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / Visual Studio.NET / Extensibility / July 2005

Tip: Looking for answers? Try searching our database.

Launching pdf file from within Visual Studio

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
NS - 29 Jul 2005 18:41 GMT
Hi,

I have a addin which when clicked should open a pdf document, may be outside
Visaul Studio IDE.

How can I do it??? I would appreciate if someone can suggest me something.

Thanx,
NS
Anna-Jayne Metcalfe - 31 Jul 2005 13:48 GMT
Hi NS,

> I have a addin which when clicked should open a pdf document, may be
> outside
> Visaul Studio IDE.
>
> How can I do it??? I would appreciate if someone can suggest me something.

By coincidence we already do this in one of our products. The code to open a
URL (including PDF documents) within the internal Visual Studio browser is:

  EnvDTE::WindowsPtr ptrWindows = m_pDTE->GetWindows();
  IfNullIssueError(ptrWindows);

  // Get the first window that's a browser.
  EnvDTE::WindowPtr ptrBrowserWindow = ptrWindows->Item(
CComVariant(CComBSTR(EnvDTE::vsWindowKindWebBrowser) ) );
  IfNullIssueError(ptrBrowserWindow);

  // Force the window to be visible.
  ptrBrowserWindow->PutVisible(true);

  // Retrieve an interface to the Internet Explorer control inside the
browser window.
  SHDocVw::IWebBrowser2Ptr ptrBrowser =
(SHDocVw::IWebBrowser2Ptr)ptrBrowserWindow->GetObject();

  // Navigate to the URL
  hr = ptrBrowser->Navigate( _bstr_t(sUrl), // Target URL
         NULL,   // Flags
         NULL,   // Target frame name
         NULL,   // PostData
         NULL);   // Headers

Hope that helps!

Kind Regards,

   Anna-Jayne Metcalfe

   Software/Product Development Consultant,
   Riverblade Limited.
   http://www.riverblade.co.uk

Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.