Get Office Version by Office Automation

Version is the property of the word::Applicatin. Not a method. So you should do it as follow:

var app = document.OA1.GetApplication();
var version = app.Version;
window.alert(version);

What is server URL means?

What is server URL means in some method of the Edraw component?

OfficeViewer can read a document from memory?

Hi,

I have a encrypted document in the filesystem. I want to decrypt this document in memory and send it to OfficeViewer without use of temporal files. Is there a way to do it?

Thanks.

Open password protected word and excel file programmatically

The Edraw Excel Viewer Component and Word Viewer Component support to ppen password protected word and excel file programmatically. You need call the SetValue method to set the password and writepassword before you call the Open method.

boolean SetValue([in] BSTR Name, [in] BSTR Value);
Sets the pasword, writepassword, domain and protectmodereminder
for the document.
Name: The name string.
Value: The value string.
Example
The following vb script shows how to open a password-protected document. if the 1.docx file
has the password 1234, the writepassword 5678, you can use the follow sample.
Sub SetValue_Example()
edword.SetValue “Password”, “1234”
edword.SetValue “WritePassword”, “5678”
edword.Open “c:\1.docx”
End Sub

Protect word document from changes

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: Optional Object. The password required to remove protection from the specified
document.
enum WdProtectType
{
wdAllowOnlyRevisions = 0,
wdAllowOnlyComments = 1,
wdAllowOnlyFormFields = 2,
wdAllowOnlyReading = 3,
wdNoProtection = -1,
}WdProtectType;
Example
The following vb script shows how to protect a document for only revisions.
Sub ProtectDoc_Example()
edword.ProtectDoc 0
End Sub

Edraw Viewer with Excel COM/Excel Add-in

I have been looking at Edraw for my next up coming project. I noticed that Edraw does not detect the Excel UDF/Excel Add-in but it does detect the COM add-in can you please put me in right direction.

How to go to special postion in the MS Word

Edraw Viewer Component for Word added some methods to do the office automation. The GotoItem method helps to position the cursor in MS Word document.

boolean GotoItem([in] WdGoToItem What, [in]
WdGoToDirection Which, [in, optional] VARIANT Count, [in,
optional] VARIANT Name);
Goes to the specified item in the Word document.
What: Optional Object. The kind of item to which the range or selection is moved. Can be one
of the WdGoToItem constants.
Which: Optional Object. The item to which the range or selection is moved. Can be one of the
WdGoToDirection constants.
Count: Optional Object. The number of the item in the document. The default value is 1.
Only positive values are valid. To specify an item that precedes the range or selection, use
wdGoToPrevious as the Which argument and specify a Count value.
Name: Optional Object. If the What argument is wdGoToBookmark, wdGoToComment,
wdGoToField, or wdGoToObject, this argument specifies a name.
enum WdGoToItem
{
wdGoToStart = 101,
wdGoToEnd = 102,
wdGoToBookmark = -1 ,
wdGoToComment = 6 ,
wdGoToEndnote = 5 ,
wdGoToEquation = 10 ,
wdGoToField = 7 ,
wdGoToFootnote = 4 ,
wdGoToGrammaticalError= 14 ,
wdGoToGraphic = 8 ,
wdGoToHeading= 11 ,
wdGoToLine = 3 ,
wdGoToObject = 9 ,
wdGoToPage = 1 ,
wdGoToPercent = 12 ,
wdGoToProofreadingError = 15 ,
wdGoToSection = 0 ,
wdGoToSpellingError = 13 ,
wdGoToTable = 2 ,
}WdGoToItem;
enum WdGoToDirection
{
wdGoToAbsolute = 1,
wdGoToFirst = 1,
wdGoToLast = -1 ,
wdGoToNext = 2 ,
wdGoToPrevious = 3 ,
wdGoToRelative = 2 ,
}WdGoToDirection;
Example
The following java script shows how to go to the file end.
function GoToItem_Example ()
{
Edword.GoToItem( 102, 1 );
}

Problem with office viewer component in PowerBuilder

Problem with version 7.1.0.303 in PowerBuilder 12.

I have this code in my application.

lb_DocumentOpened = ole_OfficeViewer.object.Open (“C:\Data\E2FTEMPGB50714\E2FEASSMPLVWGB5071420111018145647897.DOCX”, “Word.Document” )
lole_WordDocument = ole_OfficeViewer.object.ActiveDocument

lb_DocumentOpened is true so from the code it looks like the document is opened, but when I try to get the ActiveDocument it is null. The viewer is blank as well.

There used to be a couple settings in the old version that don’t work anymore such as

This.object.FrameHookPolicy = 1
this.object.ActivationPolicy = Parent.dsoKeepUIActiveOnAppDeactive

I don’t know if this has anything to do with it.

Prints all or part of the specified word document with settings

Edraw Word Viewer Component has the PrintOut method which support to print all or part of the specified document with settings.

boolean PrintOut( WdPrintOutRange PrintRange, [in, optional]
VARIANT FromPage, [in, optional] VARIANT ToPage, [in,
optional] VARIANT Pages, [in, optional] VARIANT Copies);
PrintRange: Optional Object. The page range. Can be any WdPrintOutRange constant.
FromPage: Optional Object. The starting page number when Range is set to wdPrintFromTo.
ToPage: Optional Object. The ending page number when Range is set to wdPrintFromTo.
Pages: Optional Object. The page numbers and page ranges to be printed, separated by
commas. For example, “2, 6-10″ prints page 2 and pages 6 through 10.
Copies: Optional Object. The number of copies to be printed.
enum WdPrintOutRange
{
wdPrintAllDocument = 0,
wdPrintSelection = 1,
wdPrintCurrentPage = 2,
wdPrintFromTo = 3,
wdPrintRangeOfPages = 4
};
Example
The following vb script shows how to print the 3-6 page in a document.
Sub PrintOut_Example()
edword.PrintOut 3, 3, 6
End Sub

Embed MS Word in the Visual C++ Project

Embed MS Word in the Visual C++ Project

Adding the word control to a simple dialog base Application
1. Begin a new MFC AppWizard(exe) dialog base Application.
2. Open The Resources Dialogs.
3. Select the Main Dialog and right click on it.
4. From pop-up menu select “Insert ActiveX Control…”.
5. Select Edraw Viewer Component For Word from the list.
6. Add a member variable to newly created control in the dialog class.
7. This will automatically generate new cpp and .h files which including the information of
edword control.
8. Call the MFC ClassWizard to add the control event message
To resize the control according the form add a new Window Message Handler WM_SIZE and
add the following code in OnSize virtual function
if(!::IsWindow(m_edword.m_hWnd)) return;
m_edword.MoveWindow(0,0,cx,cy);
See VCEDWordDemo c++ example
Upgrade a control in VC++
You can easily upgrade a VC++ project witch is using a EDWord control of a previous version:
1. Register the new version of control using the regsvr32 utility that is located in
windows system directory.
2. From Project menu select Add to Project -> Components and Controls
3. From Components and Control Gallery dialog select the folder Registered ActiveX
Controls
4. Find and select Edraw Viewer Component For Word and click OK to all next dialogs.
5. Rebuild the project.