<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Office Viewer Component &#187; Office Automation</title>
	<atom:link href="http://www.ocxt.com/archives/category/office-automation/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ocxt.com</link>
	<description>ActiveX document container for hosting Office documents and PDF (including Adobe PDF, Microsoft Word, Microsoft Excel, Microsoft PowerPoint, Microsoft Project and Microsoft Visio documents)</description>
	<lastBuildDate>Sat, 28 Jan 2012 11:37:01 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>How to insert HTML table into Word doc using Javascript?</title>
		<link>http://www.ocxt.com/archives/144</link>
		<comments>http://www.ocxt.com/archives/144#comments</comments>
		<pubDate>Thu, 03 Feb 2011 03:41:22 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=144</guid>
		<description><![CDATA[Use Edraw Office Viewer Component or Word Viewer Component to get the Document interface, then you can do it by the office automation. document.OA1.CreateNew(&#8220;Word.Document&#8221;); var objWord = document.OA1.ActiveDocument; var range = objWord.Range(0,0); var WTable = objWord.Tables.Add(range, 3,3); WTable.Cell(1,1).Range.Font.Name = &#8220;Times New Roman&#8221;; WTable.Cell(1,1).Range.Text = &#8220;examples 1&#8243;; WTable.Cell(1,2).Range.Font.Size = 18; WTable.Cell(1,2).Range.Bold = true; WTable.Cell(1,2).Range.Font.Italic = true; [...]]]></description>
			<content:encoded><![CDATA[<p>Use Edraw Office Viewer Component or Word Viewer Component to get the Document interface, then you can do it by the office automation.</p>
<p>document.OA1.CreateNew(&#8220;Word.Document&#8221;);<br />
var objWord = document.OA1.ActiveDocument;<br />
var range = objWord.Range(0,0);<br />
var WTable = objWord.Tables.Add(range, 3,3);<br />
WTable.Cell(1,1).Range.Font.Name = &#8220;Times New Roman&#8221;;</p>
<p>WTable.Cell(1,1).Range.Text = &#8220;examples 1&#8243;;<br />
WTable.Cell(1,2).Range.Font.Size = 18;<br />
WTable.Cell(1,2).Range.Bold = true;<br />
WTable.Cell(1,2).Range.Font.Italic = true;<br />
WTable.Cell(1,2).Range.Text = &#8220;examples 2&#8243;;<br />
WTable.Cell(2,1).Range.ParagraphFormat.Alignment = 1; // 0= Left, 1=Center, 2=Right<br />
WTable.Cell(2,1).Range.Font.Name = &#8220;Arial&#8221;;<br />
WTable.Cell(2,1).Range.Font.Size = 12;<br />
WTable.Cell(2,1).Range.Bold = false;<br />
WTable.Cell(2,1).Range.ParagraphFormat.Alignment = 2;<br />
WTable.Cell(3,3).Range.Font.Name = &#8220;Times New Roman&#8221;;<br />
WTable.Cell(3,3).Range.Font.Size = 14;<br />
WTable.Cell(3,3).Range.Bold = true;<br />
WTable.Cell(3,3).Range.Font.Underline = true;<br />
WTable.Cell(3,3).Range.ParagraphFormat.Alignment = 0;<br />
WTable.Cell(3,2).Range.Text = &#8220;examples 3&#8243;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/144/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Embedding ms office in C# Forms</title>
		<link>http://www.ocxt.com/archives/40</link>
		<comments>http://www.ocxt.com/archives/40#comments</comments>
		<pubDate>Wed, 12 Jan 2011 08:34:09 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>
		<category><![CDATA[Tech Support]]></category>
		<category><![CDATA[embedding office]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/archives/40</guid>
		<description><![CDATA[With Edraw Office Viewer Component, it&#8217;s easy to embed the ms office program in c# froms or html pages. Only drag it to your form, you can call some method to do the office automation directly such create a Word document or initialize an Excel sheet. 1. Download Edraw Office Viewer Component then install it. [...]]]></description>
			<content:encoded><![CDATA[<p>With Edraw Office Viewer Component, it&#8217;s easy to embed the ms office program in c# froms or html pages. Only drag it to your form, you can call some method to do the office automation directly such create a Word document or initialize an Excel sheet.</p>
<p>1. Download Edraw Office Viewer Component then install it. Or you can register the officeviewer.ocx using regsvr32 command.<br />
  C:\\WINNT\System32\regsvr32 OfficeVidewer.ocx<br />
2. On successful registration you would get message dialog.<br />
3. Add Office Viewer Active-X control on your form through customize toolbox window.<br />
4. Drag and drop component from toolbox on your form and resize as per requirement.<br />
5. Now add reference for &#8220;Microsoft Word Object Library 11.0&#8243; from add reference on solution explorer. Here I am using Word 2003, so object library version is 11.0.<br />
6. You can see all added reference on solution explorer as shown in figure. Two reference has been added for Edraw Office Viewer  Component (AxOfficeViewer and OfficeViewer) and three libraries for Office &amp; Word (Microsoft.Office.Core and Office and Word).<br />
7. Define a variable for word document in public section of form as<br />
   public Word.Document oDoc;<br />
8. Add following code for button click event<br />
private void button1_Click(object sender, System.EventArgs e)<br />
{<br />
     //Remove Office Viewer Component Title Bar and create a new Word document<br />
     axOfficeViewer1.Titlebar = false;<br />
     axOfficeViewer1.CreateNew(&#8220;Word.Document&#8221;);<br />
     axOfficeViewer1.Activate();<br />
     //Invoke Word properties<br />
     oDoc = (Word.Document)axOfficeViewer1.ActiveDocument;<br />
     oDoc.ActiveWindow.View.Type = Word.WdViewType.wdOutlineView;<br />
     oDoc.ActiveWindow.DisplayRulers = false;<br />
     oDoc.ActiveWindow.DisplayScreenTips = false;<br />
     oDoc.ActiveWindow.DisplayHorizontalScrollBar = false;<br />
     oDoc.ActiveWindow.DisplayVerticalRuler = false;<br />
     oDoc.ActiveWindow.DisplayVerticalScrollBar = true;<br />
}<br />
10. Now you can add text, format it, send mail do all functionalities.<br />
11. You can control all word functionalities to be made available or unavailable programmatically through code with all available objects, properties &amp; Methods of word.</p>
<p> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/40/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Disables the hotkeys in the MS Word programmatically</title>
		<link>http://www.ocxt.com/archives/164</link>
		<comments>http://www.ocxt.com/archives/164#comments</comments>
		<pubDate>Wed, 17 Nov 2010 10:47:47 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=164</guid>
		<description><![CDATA[Edraw Viewer Component for Word provides some methods to disable the print, save and copy hotkeys. boolean DisableSaveHotKey(boolean Disable); Disables the Save keycodes. Disalbe: Disables the CTRL+S, SHIFT+F12, Alt+SHIFT+F2, F12 boolean DisablePrintHotKey(boolean Disable); Disables the Print keycodes. Disalbe: Disables the CTRL+P, CTRL+SHIFT+F12, CTRL+F2, ALT+CTRL+I boolean DisableCopyHotKey(boolean Disable); Disables the Copy keycodes. Disalbe: Disables the CTRL+C, [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Edraw Viewer Component for Word provides some methods to disable the print, save and copy hotkeys.</strong></p>
<p>boolean <strong>DisableSaveHotKey</strong>(boolean Disable);<br />
Disables the Save keycodes.<br />
Disalbe: Disables the CTRL+S, SHIFT+F12, Alt+SHIFT+F2, F12<br />
boolean <strong>DisablePrintHotKey</strong>(boolean Disable);<br />
Disables the Print keycodes.<br />
Disalbe: Disables the CTRL+P, CTRL+SHIFT+F12, CTRL+F2, ALT+CTRL+I<br />
boolean <strong>DisableCopyHotKey</strong>(boolean Disable);<br />
Disables the Copy keycodes.<br />
Disalbe: Disables the CTRL+C, CTRL+V, CTRL+X, SHIFT+DEL, SHIFT+INSERT, ALT+CTRL+V,<br />
CTRL+SHIFT+C, CTRL+INSERT</p>
<p>You can call these methods at the DocumentOpened event.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/164/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Protect word document from changes</title>
		<link>http://www.ocxt.com/archives/173</link>
		<comments>http://www.ocxt.com/archives/173#comments</comments>
		<pubDate>Fri, 19 Feb 2010 14:21:50 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=173</guid>
		<description><![CDATA[Edraw Word Viewer Component added the ProtectDoc method which helps to protect the specified document from changes. When a document is protected, users can make only limited changes, such as adding annotations, making revisions, or completing a form. boolean ProtectDoc(WdProtectType ProtectType, [in, optional] VARIANT Password); ProtectType: The protection type for the specified document. WdProtectionType. Password: [...]]]></description>
			<content:encoded><![CDATA[<p>Edraw Word Viewer Component added the ProtectDoc method which helps to protect the specified document from changes. When a document is protected, users can make only limited changes, such as adding annotations, making revisions, or completing a form.</p>
<p>boolean ProtectDoc(WdProtectType ProtectType, [in, optional]<br />
VARIANT Password);<br />
ProtectType: The protection type for the specified document. WdProtectionType.<br />
Password: Optional Object. The password required to remove protection from the specified<br />
document.<br />
enum WdProtectType<br />
{<br />
wdAllowOnlyRevisions = 0,<br />
wdAllowOnlyComments = 1,<br />
wdAllowOnlyFormFields = 2,<br />
wdAllowOnlyReading = 3,<br />
wdNoProtection = -1,<br />
}WdProtectType;<br />
Example<br />
The following vb script shows how to protect a document for only revisions.<br />
Sub ProtectDoc_Example()<br />
edword.ProtectDoc 0<br />
End Sub</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/173/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Add some text at the end of Word document</title>
		<link>http://www.ocxt.com/archives/76</link>
		<comments>http://www.ocxt.com/archives/76#comments</comments>
		<pubDate>Sun, 05 Jul 2009 01:07:04 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/archives/76</guid>
		<description><![CDATA[How to add some text at the end of document that is opened in Edraw office viewer, Kindly send me java script code so that i can enter signatures in my document. Please reply as soon as possible and send my java script Example.]]></description>
			<content:encoded><![CDATA[<p>How to add some text at the end of document that is opened in Edraw office viewer, Kindly send me java script code so that i can enter signatures in my document. Please reply as soon as possible and send my java script Example.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/76/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>About the Application method</title>
		<link>http://www.ocxt.com/archives/189</link>
		<comments>http://www.ocxt.com/archives/189#comments</comments>
		<pubDate>Thu, 15 Jan 2009 15:14:12 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=189</guid>
		<description><![CDATA[The new version has the GetApplication method.  You can use it to replace the Application method.   If you want to call the print dialog, you can use the follow method.   EDOffice.PrintDialog]]></description>
			<content:encoded><![CDATA[<p>The new version has the GetApplication method.  You can use it to replace the Application method.<br />
 <br />
If you want to call the print dialog, you can use the follow method.<br />
 <br />
EDOffice.PrintDialog</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/189/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Play slideshow in the same window</title>
		<link>http://www.ocxt.com/archives/47</link>
		<comments>http://www.ocxt.com/archives/47#comments</comments>
		<pubDate>Mon, 23 Jun 2008 04:45:26 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/archives/47</guid>
		<description><![CDATA[Edraw Office Viewer Component provides a solution for opening then playing the slideshow file in the same window. Of course you can play it with full screen mode too. Simply call the &#8220;SlideShowOpenAndPlay&#8221; method, you can get the follow effect immediately. You can show or hide the titlebar, screenbar, toolbar too. You can call it via [...]]]></description>
			<content:encoded><![CDATA[<p>Edraw Office Viewer Component provides a solution for opening then playing the slideshow file in the same window. Of course you can play it with full screen mode too.</p>
<p>Simply call the &#8220;SlideShowOpenAndPlay&#8221; method, you can get the follow effect immediately.</p>
<p><img title="PowerPoint Viewer ActiveX Control" src="http://www.ocxt.com/images/pptslide500.gif" alt="PowerPoint Viewer ActiveX Control" /></p>
<p>You can show or hide the titlebar, screenbar, toolbar too.</p>
<p>You can call it via javascript or vbscript in your html page as follow.</p>
<p>document.OA1.SlideShowOpenAndPlay(&#8220;<a href="http://www.ocxt.com/demo/samples/sample.ppt">http://www.ocxt.com/demo/samples/sample.ppt</a>&#8220;, false, false, false, false);</p>
<p>OR:</p>
<p>OA1.Open(&#8220;<a href="http://www..../sample.pps">http://www&#8230;./sample.pps</a>&#8220;, &#8220;PowerPoint.Slide&#8221;);</p>
<p>OA1.SlideShowPlay(false, false, true, false);</p>
<p>[id(99), helpstring("Opens then plays the PowerPoint slide show file in the same window or full screen.")]<br />
HRESULT SlideShowOpenAndPlay([in] VARIANT Document, [in] VARIANT_BOOL bFullScreen, [in] VARIANT_BOOL bShowWebToolbar, [in] VARIANT_BOOL bLoopUntilStopped, [in] VARIANT_BOOL bShowScrollBar, [in, optional] VARIANT WebUsername, [in, optional] VARIANT WebPassword);</p>
<p>[id(100), helpstring("Plays the PowerPoint slide show file in the same window or full screen.")]<br />
HRESULT SlideShowPlay([in] VARIANT_BOOL bFullScreen, [in] VARIANT_BOOL bShowWebToolbar, [in] VARIANT_BOOL bLoopUntilStopped, [in] VARIANT_BOOL bShowScrollBar);</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/47/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to do the office automation in Delphi</title>
		<link>http://www.ocxt.com/archives/136</link>
		<comments>http://www.ocxt.com/archives/136#comments</comments>
		<pubDate>Fri, 09 May 2008 03:22:34 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>
		<category><![CDATA[Tech Support]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=136</guid>
		<description><![CDATA[We want to use this component to pilot Word and Visio documents, but we have certain problems and I would like to ask you some questions : In Word, I use bookmarks to automatically insert data, like date, name of the user. To do this, in my code I use WordGotoItem function :     OfficeViewer_1.WordGotoItem(wdGoToBookmark, [...]]]></description>
			<content:encoded><![CDATA[<p>We want to use this component to pilot Word and Visio documents, but we have certain problems and I would like to ask you some questions :</p>
<p>In Word, I use bookmarks to automatically insert data, like date, name of the user. To do this, in my code I use WordGotoItem function :</p>
<p>    OfficeViewer_1.WordGotoItem(wdGoToBookmark, wdGoToFirst, 1, &#8216;Name&#8217;);</p>
<p>but it doesn’t work, and I don’t know why.</p>
<p>Could you give me more information about this function and what’s wrong in my code ?</p>
<p>And I have another question :</p>
<p>How do I reach the header or footer of the word document ? Is there a function ?</p>
<p> </p>
<p>Edraw Office Viewer Component can work in Delphi 2007/2009 for the office automation.</p>
<p>For example:<br />
 <br />
var<br />
p1,p2: OleVariant;<br />
OleAPP,OleDoc,MenuBar: OleVariant;<br />
begin<br />
  OfficeViewer.Toolbars:=FALSE; <br />
  OfficeViewer.Titlebar:=FALSE;<br />
  p1:=DocFileName;<br />
  p2:=TRUE;<br />
  OfficeViewer.Open(DocFileName);<br />
  OleDoc:=OfficeViewer.ActiveDocument; // IDispatch Document<br />
  OleAPP:=OleDoc.application; // IDispatch Document.application<br />
  // &#8212;&#8212;&#8212; WORD &#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
  OleAPP.ActiveWindow.DisplayRulers := False;<br />
  OleAPP.ActiveWindow.View.Type := 1; // wdNormalView=1<br />
  // no popup<br />
  oleDoc.CommandBars['Text'].Enabled := False;<br />
  try<br />
   OleDoc.Protect(1,Null,&#8217;ppkLock&#8217;);<br />
  except<br />
  end;<br />
end;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/136/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Replace words in Office ActiveX Control</title>
		<link>http://www.ocxt.com/archives/134</link>
		<comments>http://www.ocxt.com/archives/134#comments</comments>
		<pubDate>Mon, 03 Mar 2008 07:11:22 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=134</guid>
		<description><![CDATA[In my ASPX page I want to find and replace some predefined words. I am using the following code, but it say objWord.Selection is not there. ( where as this is supported by word ) Set objWord = document.OA1.GetApplication Set objSelection = objWord.Selection objSelection.Find.ClearFormatting objSelection.Find.Replacement.ClearFormatting objSelection.Find.Text = varFind objSelection.Find.Replacement.Text = varReplace objSelection.Find.Forward = True objSelection.Find.Wrap [...]]]></description>
			<content:encoded><![CDATA[<p>In my ASPX page I want to find and replace some predefined words. I am<br />
using the following code, but it say objWord.Selection is not there. (<br />
where as this is supported by word )<br />
Set objWord = document.OA1.GetApplication<br />
Set objSelection = objWord.Selection<br />
objSelection.Find.ClearFormatting<br />
objSelection.Find.Replacement.ClearFormatting<br />
objSelection.Find.Text = varFind<br />
objSelection.Find.Replacement.Text = varReplace<br />
objSelection.Find.Forward = True<br />
objSelection.Find.Wrap = wdFindContinue<br />
objSelection.Find.Format = False<br />
objSelection.Find.MatchCase = False<br />
objSelection.Find.MatchWholeWord = False<br />
objSelection.Find.MatchWildcards = False<br />
objSelection.Find.MatchSoundsLike = False<br />
objSelection.Find.MatchAllWordForms = False<br />
objSelection.Find.Execute<br />
Please let me know how can I find and replace word in the client side<br />
word with OA1 activeX<strong>.</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/134/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Inserts a file to opened Word file programmatically</title>
		<link>http://www.ocxt.com/archives/170</link>
		<comments>http://www.ocxt.com/archives/170#comments</comments>
		<pubDate>Thu, 28 Feb 2008 11:12:09 +0000</pubDate>
		<dc:creator>office viewer</dc:creator>
				<category><![CDATA[Office Automation]]></category>

		<guid isPermaLink="false">http://www.ocxt.com/?p=170</guid>
		<description><![CDATA[boolean InsertFile([in] BSTR FilePath, [in, optional] VARIANT InDocPos); Inserts a file to opened Word file. FilePath: The file path need to be inserted. InDocPos: The insert position. WdInPocPos. enum WdInDocPos { wdInDocumentPosCursor = 1, wdInDocumentPosStart = 2, wdInDocumentPosEnd = 3 , }WdInDocPos;]]></description>
			<content:encoded><![CDATA[<p>boolean InsertFile([in] BSTR FilePath, [in, optional] VARIANT<br />
InDocPos);<br />
Inserts a file to opened Word file.<br />
FilePath: The file path need to be inserted.<br />
InDocPos: The insert position. WdInPocPos.<br />
enum WdInDocPos<br />
{<br />
wdInDocumentPosCursor = 1,<br />
wdInDocumentPosStart = 2,<br />
wdInDocumentPosEnd = 3 ,<br />
}WdInDocPos;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.ocxt.com/archives/170/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

