Link to home
Start Free TrialLog in
Avatar of Netsol-NOS
Netsol-NOS

asked on

MS Office 2010 Format

please see that we are using below code for generating stationary in our application.

Environment Details:-


Operating System = Windows 2008 R2 Enterprise Edition.
PowerBuilder Virtual Machine = PBVM 12.5 (means we are using PowerBuilder 12.5)
MS Office Template Used in application = Ms Office 2003.
We need to convert the template in = Ms Office 2010.


Code:-
li_result = ole_word.ConnectToObject("", "word.application")
IF li_result < 0 THEN
                li_result = ole_word.ConnectToNewObject("word.application")
END IF

IF li_result <> 0 THEN
                DESTROY ole_word
                ib_connected = FALSE
                MessageBox('MSWord Problem','Could Not Connect to MSWORD~n~nPlease make sure word runs properly on your machine~nRestart System')
                RETURN -1
END IF

ib_connected = TRUE
ole_word.Application.Visible = FALSE

RETURN 1

Our Application not allow to upload/attach the *.docx file. As mentioned in below screenshot.

Your kind help will be highly appreciated.
1.jpg
Avatar of Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Boyd (HiTechCoach) Trimmell, Microsoft Access MVP 2010-2015
Flag of United States of America image

The issue is not with the code you posted but the code that opens the file selection dialog box. The  File Type filter needs updated to included the new document types.

Example:

openFileDialog.InitialDirectory = @"c:\"; openFileDialog.Filter = "Word 2000-2003|*.doc|Word 2007/2010|*.docx|All|*.*"; openFileDialog.ShowDialog();

Open in new window

ASKER CERTIFIED SOLUTION
Avatar of imtiaza
imtiaza
Flag of Pakistan image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Netsol-NOS
Netsol-NOS

ASKER

50% solution.