[Solved] Switch to View HTML Source

The Application Programming Interface and the OASIS Open Document Format

[Solved] Switch to View HTML Source

Postby edwardrussia » Tue Oct 18, 2011 12:00 am

I found this code for switching to Web Layout view: viewtopic.php?f=7&t=36948 (see below)

But I really want to switch to View HTML Source in OOo Writer. Could someone tell me how to change the code? My searches have been unsuccessful.

Thanks for any help you can give me!

Code: Select all   Expand viewCollapse view
rem get access to the document
document   = ThisComponent.CurrentController.Frame
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")

rem ----------------------------------------------------------------------
dim args1(0) as new com.sun.star.beans.PropertyValue
args1(0).Name = "BrowseView"
args1(0).Value = true

dispatcher.executeDispatch(document, ".uno:BrowseView", "", 0, args1())
Last edited by edwardrussia on Tue Oct 18, 2011 9:42 pm, edited 1 time in total.
OOo 3.4.1; WindowsXP
edwardrussia
 
Posts: 16
Joined: Thu Oct 14, 2010 11:08 pm

Re: Switch to View HTML Source

Postby MrProgrammer » Tue Oct 18, 2011 5:20 pm

See Framework Commands. Based on that, I'd suggest that you try:
Code: Select all   Expand viewCollapse view
dispatcher = createUnoService("com.sun.star.frame.DispatchHelper")
dim argsSV(0) as new com.sun.star.beans.PropertyValue
argsSV
(0).Name = "SourceView" : argsSV(0).Value = true
dispatcher
.executeDispatch(ThisComponent.CurrentController.Frame,".uno:SourceView","",0,argsSV()) 

If you want to start writing/modifying macros, you should read http://www.pitonyak.org/AndrewMacro.odt and then become familiar with the API and the other resources at the Macros and UNI API forum.
Last edited by MrProgrammer on Mon Nov 12, 2012 4:18 pm, edited 1 time in total.
Mr. Programmer
AOO 4.1.7 Build 9800 on MacOS 10.14.6.   The locale for any menus or Calc formulas in my posts is English (USA).
User avatar
MrProgrammer
Moderator
 
Posts: 3955
Joined: Fri Jun 04, 2010 7:57 pm
Location: Wisconsin, USA

Re: Switch to View HTML Source

Postby edwardrussia » Tue Oct 18, 2011 9:40 pm

That's great - it works! Thanks for the link - I would have never found it myself!
OOo 3.4.1; WindowsXP
edwardrussia
 
Posts: 16
Joined: Thu Oct 14, 2010 11:08 pm


Return to UNO API and ODF

Who is online

Users browsing this forum: No registered users and 2 guests