1. ezhilarasan tirupalirajendiran
  2. PowerBuilder
  3. Wednesday, 16 November 2022 10:56 AM UTC

Hi Team,

1) we have created nv_ole_word object and performed some operations
2) we have already used some VBA code also. For example below,
IF ib_visual_basic then
this.ActiveDocument.Save()
else
this.FileSave()
end if
return true

3)Question: I need a page count from an existing word doc in powerbuilder

I want to migrate VBA syntax to PowerBuilder code.
Selection.Range.Information(wdActiveEndPageNumber)

Could you please let me know how to change the above VBA syntax to a powerbuilder
Selection.Range.Information( XXXXXXXXXXXX )

Thanks in Advance!

Regards,
Ezhilarasan TR

René Ullrich Accepted Answer Pending Moderation
  1. Wednesday, 16 November 2022 11:30 AM UTC
  2. PowerBuilder
  3. # 1

Hi,

It's not so complicated to convert VBA to OLE commands.

The problem in you case: You need to use the values instead of VBA constants. 

wdActiveEndPageNumber = 3

You can find this infomation if you use the VBA object catalog (Press F2 in VBA editor in Word=.

HTH,

René

Comment
There are no comments made yet.
John Fauss Accepted Answer Pending Moderation
  1. Wednesday, 16 November 2022 15:31 PM UTC
  2. PowerBuilder
  3. # 2

Rene is correct.

Please note that Office VBA Object Model information is also available online. For MS Word:

    https://learn.microsoft.com/en-us/office/vba/api/overview/Word/object-model

Searching from the above page for the Range object, then at the Information property of the Range object, then for the InformationType enumerated type named "wdInformation" parameter:

    https://learn.microsoft.com/en-us/office/vba/api/word.wdinformation

shows that wdActiveEndPageNumber = 3.

Best regards, John

Comment
There are no comments made yet.
  • Page :
  • 1


There are no replies made for this question yet.
However, you are not allowed to reply to this question.