I want to check the activedocument has selection or not.
I could not find the ways to check the "Selection"
thks
thks
check the activedocument has selection or not
check the activedocument has selection or not
This works.
function hasSelection(doc) {
var res;
try {
doc.selection.bounds; // throws if there's no selection
res = true;
} catch(e) {
res = false;
}
return res;
}
function hasSelection(doc) {
var res;
try {
doc.selection.bounds; // throws if there's no selection
res = true;
} catch(e) {
res = false;
}
return res;
}
check the activedocument has selection or not
xbytor wrote:This works.
function hasSelection(doc) {
var res;
try {
doc.selection.bounds; // throws if there's no selection
res = true;
} catch(e) {
res = false;
}
return res;
}
Good idea! THS
Itry to use vbs according to your code
On Error GoTo err0
objApp.ActiveDocument.Selection.TranslateBoundary 0, 0
MsgBox "have"
Exit Sub
err0:
MsgBox "no"
THS
function hasSelection(doc) {
var res;
try {
doc.selection.bounds; // throws if there's no selection
res = true;
} catch(e) {
res = false;
}
return res;
}
Good idea! THS
Itry to use vbs according to your code
On Error GoTo err0
objApp.ActiveDocument.Selection.TranslateBoundary 0, 0
MsgBox "have"
Exit Sub
err0:
MsgBox "no"
THS