![]() |
link to pdf file & menu bar in user form
Hi, I am new here and just started to learn Excel VBA. I've got a few questions. Hope someone could give me a hand. :) 1) how to link a pdf file to a control button in a user form? 2) i found some code to add menu bar in a spreadsheet, but how to add it in a user form? thanks -- Fendic ------------------------------------------------------------------------ Fendic's Profile: http://www.excelforum.com/member.php...o&userid=23959 View this thread: http://www.excelforum.com/showthread...hreadid=375835 |
link to pdf file & menu bar in user form
Fendic,
1. the easiest way to launch a different programs file is to use the ShellExecute API call. Declare Function ShellExecute Lib "shell32.dll" Alias _ "ShellExecuteA" (ByVal hwnd As Long, ByVal lpOperation As String, _ ByVal lpFile As String, ByVal lpParameters As String, _ ByVal lpDirectory As String, ByVal nShowCmd As Long) As Long Sub Test() lreturn = ShellExecute(0, vbNullString, _ "E:\My Documents\My Downloads\Redmond Mags\RED_506DG.pdf", _ vbNullString, vbNullString, vbNormalFocus) End Sub 2. notionally you can't. the forms object model doesn't support menus. You can do it in VB, but not VBA. There have been some kludge workarounds, but I wouldn't recommend it unless absolutely crucial to you. Robin Hammond www.enhanceddatasystems.com "Fendic" wrote in message ... Hi, I am new here and just started to learn Excel VBA. I've got a few questions. Hope someone could give me a hand. :) 1) how to link a pdf file to a control button in a user form? 2) i found some code to add menu bar in a spreadsheet, but how to add it in a user form? thanks -- Fendic ------------------------------------------------------------------------ Fendic's Profile: http://www.excelforum.com/member.php...o&userid=23959 View this thread: http://www.excelforum.com/showthread...hreadid=375835 |
link to pdf file & menu bar in user form
Hi Robin, I really appreciate your help. The code works, only that I need t declare the function at the top of standard VBA module, which took m an hour to find out. hehe :rolleyes: At this level, I wonder if you or anyone else knows how to turn to certain page when the pdf file opens, or even a certain paragraph line. I know html is able to work like that, and adobe has 'go to... function. but not sure how to fix that in VBA code. Thank you. I found more and more fun in VBA now :) Fendi -- Fendi ----------------------------------------------------------------------- Fendic's Profile: http://www.excelforum.com/member.php...fo&userid=2395 View this thread: http://www.excelforum.com/showthread.php?threadid=37583 |
All times are GMT +1. The time now is 02:23 PM. |
Powered by vBulletin® Copyright ©2000 - 2025, Jelsoft Enterprises Ltd.
ExcelBanter.com